Easy way to do this is to either call out to the openssl command line tool or use an openssl library binding.
If you call out to the openssl command line tool, your code will tend to work better across openssl releases, as a variety of errors seem to keep cropping up in c# bindings calling openssl libraries directly.
RadhaKrishnaKiJaya
ASKER
Thank you David Favor,
I don't understand what you are saying.
Thank you!
Devin Becker
Radha,
On the page you linked, after the example, it says that the parameter KeySize can be assigned a Key Size, which will allow you to choose between 64, 128, or 256 Key Length. This is not show in the example, but it is possible.
EDIT: it looks like the KeySize is in bytes. which means you would uses a KeySize of 32bytes if you wanted 256Bit encryption.
Hope this helps,
Devin Becker
DevOps Associate @ EE
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
RadhaKrishnaKiJaya
ASKER
Thank you Devin. Do you have any example or sample code to show me? Thank you!
EDIT: Also worth noting the difference between bytes and bits. 1 Byte = a combination of 8 bits. 8 bits = 1 byte. 32 bytes = 256 bits. Keep this in mind when writing out your code.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
If you call out to the openssl command line tool, your code will tend to work better across openssl releases, as a variety of errors seem to keep cropping up in c# bindings calling openssl libraries directly.