> Can I use Crypto++ to decrypt a message encrypted with this java
> function?
Most likely, yes.

On Sep 6, 2:15 am, Jim Smith <[email protected]> wrote:
> Can I use Crypto++ to decrypt a message encrypted with this java
> function?
>
> public static String encrypt(String message) {
>        String key = "thekey";
>
> MessageDigest md5 = MessageDigest.getInstance("MD5");
>
> byte[] encrypt = message.getBytes();
>        SecretKeySpec
> secretKey = new SecretKeySpec(md5.digest(key.getBytes()), "AES");
>        Cipher cipher = Cipher.getInstance("AES");
>
> cipher.init(Cipher.ENCRYPT_MODE, secretKey);
>        byte[]
> cipherText = cipher.doFinal(encrypt);
>        Base64 encoder = new
> Base64();
>        return new String(encoder.encode(cipherText));
>
> }
>
> Thanks

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to