Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does OPENSSL_RAW_DATA do?

Tags:

php

encryption

I'm pretty new to PHP encryption (and encryption in general) and I've been reading about using openssl_encrypt() function of PHP.

There's an option to add a flag called OPENSSL_RAW_DATA. What does this actually do and where can I see how PHP uses this in the PHP source code?

like image 688
Artvader Avatar asked May 10 '17 07:05

Artvader


1 Answers

OPENSSL_RAW_DATA just tells openssl_encrypt() to return the cipherText as ... raw data. By default, it returns it Base64-encoded.

The source code is easy to find, but not really useful as it's not like the flag does anything extra ... The opposite - it tells PHP not to do the extra step of Base64 encoding.

like image 127
Narf Avatar answered Sep 29 '22 10:09

Narf