Rijndael Installed Enterprise Library Encryption Replacement

I have a question regarding encryption: mostly in my web application I used Enterprise Library 5.0, where they had a block for cryptography, so basically in the configuration tool they provided, I registered the block and generated the key.This basically adds a few lines to web configuration, so later in the web application I can do the following:

Cryptographer.EncryptSymmetric("RijndaelManaged", text); Cryptographer.DecryptSymmetric("RijndaelManaged", text); 

This will automatically encrypt and decrypt correctly, without any problems.

Now I have the following problem: we are moving from Enterprise Library 5.0 to Enterprise Library 6.0, and in the new version they removed the cryptography block, and instead they advise using .Net cryptography.

So instead, I decided to use the Rijndael.Net class to replace these lines with custom code. I used this topic as a link ( Encrypt and decrypt a string ), but with RijndaelManaged to create it, but I'm a little confused about the key ... because some data is already encrypted, how to get and use the same key to be able to decrypt data and use it ...?

I opened version 5.0 configuration manager to see the key, but can I use it or not?

Can anyone tell me about this?

+5
source share
1 answer

how to get and use the same key to be able to decrypt the data and use it ...?

One of the ideas of cryptographic ciphers is that they are not dependent on implementation technology. You can encrypt data using .NET and decrypt it using Java or any other. All you need to do can be summarized as:

  • Have a key. In symmetric cryptography, the same key is used for encryption and decryption processes.
  • There are configuration values ​​(such as IV or initialization vector, encryption block length, encryption type, hash function used, name cypher, etc.)

Given that you have these two, you can encrypt / decrypt any technology (with a little pain in order to succeed first and foremost, mainly to find the right key or configuration)

I opened version 5.0 configuration manager to see the key, but can I use it or not?

Not familiar with the configuration manager, but you have to extract the key from somewhere. Remember to get it in the correct format - you need a raw binary format. If it is saved in a file, it can be encrypted using the Windows DP API or it can be saved in Base64 format.

+1
source

Source: https://habr.com/ru/post/1208876/


All Articles