Discussion:
Java to C# Translation AES-256 Keygen with PKCS7
Paul Cunningham
2014-01-13 16:09:13 UTC
Permalink
To emulate a Java-based encryption scheme used with on a record in our
database, we need to know how to do this with PKCS7:

PbeParametersGenerator keyGen = new Pkcs5S2ParametersGenerator();
keyGen.Init(PbeParametersGenerator.Pkcs5PasswordToUtf8Bytes(hashedKey.ToCharArray()),
iv, 1024);
KeyParameter test = (KeyParameter)keyGen.GenerateDerivedParameters("AES",
256);

The Cipher Utility using the "test" key parameter is set up with
"AES/ECB/PKCS7Padding".

​Can anyone help us figure out how we can do this? Unfortunately, we don't
have the luxury of defining how the data gets encrypted -- that would make
things a lot easier! Thanks in advance! -pc​

Loading...