.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

what exactly happens in passphrase encryption?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

Hi ,

         I tried this with the following script :

create table Encrypt_Decrypt(username varchar(300),Password varchar(100),Encrypted_PWD varbinary(256),Decrypted_PWD varchar(100 ))

insert into Encrypt_Decrypt(username,Password)
select 'chaithu', 'aimhigh'
union all
select 'kranthi', 'something'
DECLARE @PassphraseEnteredByUser nvarchar(128 );
SET @PassphraseEnteredByUser = 'Encrypt it';

UPDATE  Encrypt_Decrypt

SET Encrypted_PWD = EncryptByPassPhrase(@PassphraseEnteredByUser , Password);

  /*DECLARE @PassphraseEnteredByUser nvarchar(128);

SET @PassphraseEnteredByUser= 'Encrypt it'; */
update  Encrypt_Decrypt set Decrypted_PWD=DECRYPTBYPASSPHRASE(@PassphraseEnteredByUser,Encrypted_PWD)

But, I am unable to figure out how internally it is performing encryption and decryption.Please help me


View Complete Post

More Related Resource Links

View State Encryption


Hi All,

Why is it that I see the same hash value generated when I use different algorithms for viewstate encryption. I have added below lines to the web.config file

<pages viewstateEncryptionMode="Always"

Cryptography: Employ Strong Encryption in Your Apps with Our CryptoUtility Component


When storing sensitive data, you need to be able to identify threats, determine how these threats interact with each other, and how issues can combine to constitute a vulnerability that will leave your data exposed. With a good understanding of the various cryptographic algorithms, salt, hashes, ACLs, and other available techniques, you'll be in a better position to protect your critical data.

Michael Stuart and J Sawyer

MSDN Magazine November 2004

Trustworthy Code: Exchange Data More Securely with XML Signatures and Encryption


You can sign any kind of data using XML Signature, including part of an XML document, other XML documents, or other data of any format. However, in practice, XML signatures are most frequently used to sign other data represented in XML. In this article, the authors discuss the new standard and how you can benefit from it in your apps.

Mike Downen and Shawn Farkas

MSDN Magazine November 2004

Encrypt It: Keep Your Data Secure with the New Advanced Encryption Standard


The Advanced Encryption Standard (AES) is a National Institute of Standards and Technology specification for the encryption of electronic data. It is expected to become the accepted means of encrypting digital information, including financial, telecommunications, and government data. This article presents an overview of AES and explains the algorithms it uses. Included is a complete C# implementation and examples of encrypting .NET data. After reading this article you will be able to encrypt data using AES, test AES-based software, and use AES encryption in your systems.

James McCaffrey

MSDN Magazine November 2003

.NET Remoting: Secure Your .NET Remoting Traffic by Writing an Asymmetric Encryption Channel Sink


As .NET Remoting gains popularity in the enterprise space, it must meet business demands for trustworthy computing. Remoting traffic can be secured when objects are hosted in IIS, but when they aren't hosted in IIS, custom security solutions can be developed to secure them. This article provides an in-depth look at writing channel sinks for .NET. It also details the flow of data through custom channel sinks and explains the kinds of manipulations that can be performed on that data.

Stephen Toub

MSDN Magazine June 2003

Symmetric Key Encryption on the Compact Framework

There are two main types of encryption algorithms available within the .NET Compact Framework - symmetric and asymmetric encryption. This blog entry will discuss how to utilise symmetric key encryption, but first we have to outline the difference between Symmetric and Asymmetric encryption (I will discuss asymmetric key encryption in a future blog entry).

Symmetric and Asymmetric Key Encryption
Symmetric encryption algorithms (also known as ciphers) process plain text with a secret encryption key to create encrypted data (called cipher text). The same secret key is used to decrypt the cipher text back to plain text.

Asymmetric encryption (also known as public-key encryption) is a cryptography technique that uses public and private key pairs to encrypt and decrypt data respectably. The private key is a closely guarded secret, while the public key can be freely distributed over untrusted networks. You do not worry who has your public key (you could print it on a 100foot tall banner if you so desired), but you must keep your private key secret.

URL Encryption in ASP.NET


Hi Friends

URL Encryption is important in project ...

i m using following artical for URl Encryption... It is working fine for Respons.redirect();

But not working for navigate url ....

how can this problem get resolved ...

please help me out...........


----------------------------------------------------------------------------------------------------------------------------------- Parees Solutions -----------------------------------------------------------------------------------------------------------------------------------

Encryption/Decryption OAEP

I have some code: string newKey = AmazonFeedBrowser.Security.CryptoKeyContainer.GetKeyFromContainer("KeyContainer", true); RSACryptoServiceProvider trsa = new RSACryptoServiceProvider(); trsa.FromXmlString(newKey); string tu = Convert.ToBase64String(trsa.Encrypt(Encoding.UTF8.GetBytes("Administrator"), true)); Debug.WriteLine(tu); newKey = AmazonFeedBrowser.Security.CryptoKeyContainer.GetKeyFromContainer("KeyContainer", false); trsa = new RSACryptoServiceProvider(); trsa.FromXmlString(newKey); Debug.WriteLine(Encoding.UTF8.GetString(trsa.Decrypt(Convert.FromBase64String(tu), true))); I get a cryptographic exception indicating that the OAEP padding cannot be processed. The RSACryptoServiceProvider (trsa) is initialized with just the public key. It seems to work OK with the public and private key. Is there a way to use OAEP with just the public key? Error occurred while decoding OAEP padding. System.Security.Cryptography.CryptographicException was unhandled Message=Error occurred while decoding OAEP padding. Source=mscorlib StackTrace: at System.Security.Cryptography.RSACryptoServiceProvider.DecryptKey(SafeKeyHandle pKeyContext, Byte[] pbEncryptedKey, Int32 cbEncryptedKey, Boolean fOAEP, ObjectHandleOnStack ohRetDecryptedKey) at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP) .

Install SQL Server2005 Error:[Native Client]Encryption not supported on the client

Product: Microsoft SQL Server 2005 -- Error 29515. SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client]Encryption not supported on the client. Refer to server error logs and setup logs for more information. For details on how to view setup logs, see "How to View Setup Log Files" in SQL Server Books Online.

SQL Server Compact 3.5 Encryption Questions

If I create a database (.sdf file) on a server and set it to be encrypted, should it be able to be opened on a device or other PC?  In other words, is there anything in the encryption that is machine specific?  Or is it really that the password is what lets me connect and the encryption prevents it from being read by some other tool like a hex file viewer as one post suggested. I've read through lots of posts and documentation and I'm just trying to understand how encryption works and if there are any limitations or considerations and haven't found a good source. Thanks

Coldfusion AES encryption

Hi all, I saw another post on the subject but it was for a different type of encryption. Anyway, we have some values that are stored in our database using the Coldfusion ecrypt() function. We are using AES and Hex. it looks like this: <cfset Variables.THE_VALUE_ENCRYPTED = Encrypt("#ARGUMENTS.THE_VALUE#","#Variables.ENCRYPT_KEY#","AES","Hex")> The key is 24 bit.  For the life of us, we can't find any way to decrypt this in .net. Can someone offer some guidance? IT would be greatly appreciated.

Why SQL accepts both encrypted connection and non-encrypted connections when force encryption option

I have installed a certificate and have set force encryption to yes under the flags' tab of protocols' window as well as SQLnative client configuration properties but SQL Server accepts both encrypted connection and non-encrypted connections,why?(i have checked the encrypt connection of the connection properties of connect to server window). also when i run profiler, it can capture both T-SQL statements which has run against encrypted and non-encrypted connection and i expect the profiler should not be able to get the encrypted connection's T-SQL statement,am I right or something is wrong with my  configurations?--yousef

Encryption (System.Security.Cryptography) .Net 2.0

Hi, Query regarding cryptography.  I'm using .net cryptography to encrypt and decrypt files stored on disk on an asp.net website using .Net 2.0 framework.   The code (copied below) works fine to encrypt and decrypt pdf, tif, jpg, etc.  However when it comes to MS Word documents with embedded images and/or tables I get a "Bad data" error when decrypting.   The same document saved to rtf format is encrypted and decrypted without error.  Also simple formatted text documents in Word format (Office 2003) do not throw an error when being decrypted. Would someone care to point out where I'm going wrong? Thanks, code below   _________________________________    Public Sub Encrypt(ByVal Userid As Integer, ByVal FilePath As String)        'Encrypt the file        Try            Dim EncryptedFilePath As String = FilePath & "enc"            Dim clsNetEnCrypt As New NetEncrypt(User)            clsNetEnCrypt.Encrypt(FilePath, EncryptedFilePath)            'Remove the Unencrypted file  

Email Encryption using System.Net.Mail assembly

Hi folks, Has anyone used the above assemblies to send emails using public key enryption, specifically PGP? Cheers Mark 

Basic Encryption Question

I have been looking at ways of encrypting querystrings and I have found a few good examples.. but, I just want some clarification on what is most often referred to as the EncryptionKey and the characters that are in that key....Is there basically an unlimited number of alphanumeric combinations that could be used in the following code as the encryption key, is there anything that someone should be CAREFUL about including in that key?thanks...using System.Security.Cryptography;private static string EncryptionKey = "!#$a54?3";/// other examples: "r0b1nr0y"///in a try-catch:key = System.Text.Encoding.UTF8.GetBytes(EncryptionKey.Substring(0, 8));DESCryptoServiceProvider des = new DESCryptoServiceProvider(); inputByteArray = Convert.FromBase64String(Input);

How to add encryption key automatically in MS Enterprise Library

I'm a team member in developing an enterprise application that will be generating packages to submit to the enterprise contractors to install it at their PC. One of my tasks is to add encryption to the application's fields. this was accomplished by add encryption key to app.config file and the key was generated by MS Enterprise Library manager. In the above step I have to go to the manager application and create the key then copy it and paste it to the application config file. This is valid to be done in the current machine but once we created a setup project and generated a package and send it to the contractor, this step has to be done manually and at the contractor site. Is there a way to generate the key and add it to the application config file automatically on the application setup or at package generation? I hope that my case is clear and I need your help guys as I already tried to resolve this issue and the task due date is next week and I don't want to delay it. Thanks in advance for everyone who is going to help.

RSA Data encryption

I was trying to encrypt  my data using RSA, but I got an CryptographicException "Key not valid for use in specified state". I search around the web and found this: http://social.msdn.microsoft.com/forums/en-US/clr/thread/4e3ada0a-bcaf-4c67-bdef-a6b15f5bfdce/ which suggested that RSA can only encrypt 245 bytes or less of data Does anyone one if there is a way round this? thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend