
January 28th, 2005, 04:14 PM
|
|
Registered User
|
|
Join Date: Nov 2004
Posts: 6
Time spent in forums: 2 h 10 m 46 sec
Reputation Power: 0
|
|
RSA Encryption Bad Data Error
I have an application that is to take user inputed values (such as credit card numbers) and encrypt them, then write the data to a SQL table, and eventually retrieve the data from SQL and decrypt the data.
I am receiving a "Bad Data" error when I retrieve and try to decrypt the record from SQL, BUT... if I decrypt the data before writting it to SQL (straight from the textboxes) it decrypts fine.
I am converting the textbox strings using (FromBase64) as it has been said that (UTF-8 Encoding) can cause this error.
In the table the data type that I am using is varbinary for the encrypted data.
I'm using XML files to store the Public and Private Keys
If this makes any sense does anybody have any insight?
|