I have a project where I have created a web service on the i which will be consumed by a PHP program also on the i. Here is the problem. The PHP program needs to send the customers Social Security Number with the call to the web service, but before it sends it it will encrypt the SSN using AES algorithm and then encode that in HEX before sending. The problem is that when I try to decrypt the SSN I get an error saying that the item was not encrypted.
My RPGLE program first translates the ASCII Hex to EBCDIC hex and then converts the hex to the characters and they attempts to decrypt the SSN.
To test, I wrote a program in RPGLE to encrypt, using AES, the SSN using the same key and IV as the the PHP program used and the first thing that I noticed is that the characters in the two encrypted fields, one from the RPGLE program and the other from the PHP program, do not match. I can't figure out whether the problem is in the details and setting of the encryption algorithms on each side or what.
I can't seam to find any information on the internet specifically addressing decrypting something on the IBM i that was encrypted in the ASCII world and sent to the IBM i.
Thanks in advance for any help or direction.
My RPGLE program first translates the ASCII Hex to EBCDIC hex and then converts the hex to the characters and they attempts to decrypt the SSN.
To test, I wrote a program in RPGLE to encrypt, using AES, the SSN using the same key and IV as the the PHP program used and the first thing that I noticed is that the characters in the two encrypted fields, one from the RPGLE program and the other from the PHP program, do not match. I can't figure out whether the problem is in the details and setting of the encryption algorithms on each side or what.
I can't seam to find any information on the internet specifically addressing decrypting something on the IBM i that was encrypted in the ASCII world and sent to the IBM i.
Thanks in advance for any help or direction.
Comment