codamedia — 2012-02-08T20:17:50-05:00 — #1
I have to pass a username to a webservice, and the API is asking for the following.
1: The username has to be encrypted with AES
2: The AES output has to be converted to BASE16
3: It is the BASE16 value I have to pass.
The encryption is easy - but I cannot find a way to convert the value to BASE16.
PHP does not seem to have a BASE16_ENCODE like it does for BASE64.
$value = <AES Encrypted Username>;
$base16username = base16_encode('$value'); (< Since Base16_encode does not exist, this is my problem)
Google searches are leading me nowhere, nor is the PHP online manual so I suspect I might be overlooking something obvious.
anthonysterling — 2012-02-09T03:41:36-05:00 — #2
codamedia — 2012-02-09T08:02:58-05:00 — #3
Thanks for the suggestion.
I have looked at base_convert, but I am not sure what I would be converting from.
What base number is an AES encypted string?
logic_earth — 2012-02-09T08:20:09-05:00 — #4
codamedia — 2012-02-09T08:34:23-05:00 — #5
I looked at bin2hex as well - but the AES encryption string is not binary so that is not producing the expected results.
john_betong — 2012-02-09T08:48:42-05:00 — #6
Maybe sprintf('%x %X', your_number);