I tried but for some reason it's not working. I think it's the md5 digest. I thought this would be very simple.
Where can I get an example for using Crypto++ and AES with md5? Something that would give me exactly what I need to implement a function for decryption of a message encrypted with the java method below. Thanks On Mon, Sep 6, 2010 at 11:45 PM, Jeffrey Walton <[email protected]> wrote: > > 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. > -- Regards, James Smith Tel. 215-842-2023 -- 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.
