The java code is running on the server and is in production. I can't change that.
Will SHA-1 and AES work without changing the java code? On Wed, Sep 8, 2010 at 4:38 PM, Da Co <[email protected]> wrote: > I have succesfully used SHA-1 and AES between Java and Crypto++. > You may want to try that. > > > On Wed, Sep 8, 2010 at 4:28 PM, James Smith <[email protected]>wrote: > >> 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. >> > > -- 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.
