I'm setting up the code to generate the AES hash using with 3 random numbers to generate the hash, but I don't want to generate the hash that come with the keys such as like ?
, /
, +
, =
...etc.
Here is the output for the hash that I use to generate it:
U2FsdGVkX1+nF+bhzvA/sFnQKgOKwrRNJbqr+XzJ/2k=
I want to generate the AES hash that start with FM
cap letters with the long random cap and small cap letters to make it to show like this:
FMfcgxwCgCRTpGWxctmfLpRBZxVcrkdM
Here is what I use to encrypt and decrypt the hash:
//encrypt the hash
var hash = '234';
var encryptedAES = CryptoJS.AES.encrypt(hash, "My Secret Passphrase");
//decrypt the hash
var decryptbytes = CryptoJS.AES.decrypt(hash.toString(), "My Secret Passphrase");
var email_number = decryptbytes.toString(CryptoJS.enc.Utf8);
What I'm expecting to do is to encrypt the hash using with the long random cap and small cap letters like FMfcgxwCgCRTpGWxctmfLpRBZxVcrkdM
without the keys ?
, -
, =
or whatever it is and I want to decrypt the hash to go back to numbers that I enter when I encrypted it.
Can you please show me an example how I could use CryptoJS.AES.encrypt
to encrypt the numbers to turn into 32 letters that start with FM
with the cap and small cap letters?
Thank you