Java Method That works like MySQL function AES_ENCRYPT

Web, Mobile & Software Dev Other - Software Development Posted 1 year ago

Fixed Price

Delivery by July 31, 2014

$30

Budget

Details

We have a database that has a field "password" that contains an encrypted password:

select
hex(password),
hex(AES_ENCRYPT('password','password') )
from
member where id='themember'

The output of the above SQL is:

# hex(password), hex(AES_ENCRYPT('password','password') )
'70FB3363637D6484723610B7837BEE9B', '70FB3363637D6484723610B7837BEE9B'

If the password was "password" this would have been used to create the encrypted value:

AES_ENCRYPT('password','password')

We require a Java class we can use like this:

AesEncryptHashUtils.isMatchedPassword("mypassword","encryptedbase64stringhere","mypassword");

boolean AesEncryptHashUtils.isMatchedPassword(String encryptionKey, String hexEncryptedPassword, String clearTextPassword);

Where:

encryptionKey = the password in clear text. Used as the encryption key. e.g. "password"
hexEncryptedPassword = the password encrypted using itself as the key and then turned into a hex string. e.g. "70FB3363637D6484723610B7837BEE9B"
clearTextPassword = the password in clear text as entered by the user. e.g. "password"

The method returns true if the value in hexEncryptedPassword equals the value in clearTextPassword.

The job is to create a class that implements the AES_ENCRYPT logic in pure Java code (or libs that are part of Java 1.6 Standard)

  • Other Skills:

Client Activity on this Job

Last Viewed: 1 year ago

Proposals: 21

Hired: 1


About the Client

(4.86) 35 reviews

New Zealand
Auckland 02:47 PM

82 Jobs Posted
72% Hire Rate, 1 Open Job

Over $10,000 Total Spent
61 Hires, 11 Active

$8.37/hr Avg Hourly Rate Paid
860 Hours

Member Since Mar 24, 2012