I have a question regarding the encryption: basically in my web application I've used Enterprise Library 5.0 where they had a block for cryptography, so basically in the configuration tool provided by them I've registered a block and generated a key. This basically adds few lines in the web config, so that later in web application i can do the following:
Cryptographer.EncryptSymmetric("RijndaelManaged", text);
Cryptographer.DecryptSymmetric("RijndaelManaged", text);
This would automatically encrypt and decrypt correctly, withouth any issues.
Now I've a following problem, we are moving from Enterprise Library 5.0 to Enterprise Library 6.0 and in the new version they've removed the Cryptography block and instead they advise to use .Net cryptography.
So instead I decided to use Rijndael .Net class to replace this lines with custom code. I've used this topic as a reference (Encrypt and decrypt a string) but with RijndaelManaged to create it, but i'm a bit confused, how about the key ... because some data is already encrypted how to get and use the same key to be able to decrypt the data and use it ...?
I opened the configuration manager of the version 5.0 to see the key but can i use it or not?
Can anyone elaborate me on this one?
how to get and use the same key to be able to decrypt the data and use it ...?
One of the idea of crypto cyphers is that they are independent of the implementing technology. You can encrypt data with .NET and decrypt it with Java or whatever. All you need to do can be summarised as:
Given you have those two, you can encrypt/decrypt in any technology (with a bit of pain to get it going first, mostly spent searching for correct key or configuration)
I opened the configuration manager of the version 5.0 to see the key but can i use it or not?
Not familiar with config manager, but you must extract the key from somewhere. Be sure to get it in the right format - you need raw binary format. If it is saved in a file, it could be encrypted with say Windows DP API, or could be stored in Base64 format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With