note 126267 added to function.openssl-encrypt

From: Date: Thu, 22 Jul 2021 22:02:52 +0000
Subject: note 126267 added to function.openssl-encrypt
Groups: php.notes 
Request: Send a blank email to php-notes+get-216639@lists.php.net to get a copy of this message
Concise description about "options" parameter! http://phpcoderweb.com/manual/function-openssl-encrypt_5698.html > OPENSSL_ZERO_PADDING has a direct impact on the OpenSSL context. EVP_CIPHER_CTX_set_padding() > enables or disables padding (enabled by default). So, OPENSSL_ZERO_PADDING disables padding for the > context, which means that you will have to manually apply your own padding out to the block size. > Without using OPENSSL_ZERO_PADDING, you will automatically get PKCS#7 padding. > OPENSSL_RAW_DATA does not affect the OpenSSL context but has an impact on the format of the > data returned to the caller. When OPENSSL_RAW_DATA is specified, the returned data is returned > as-is. When it is not specified, Base64 encoded data is returned to the caller. Where - OPENSSL_RAW_DATA=1 - OPENSSL_ZERO_PADDING=2 Hence options = 0 -> PKCS#7 padding, Base64 Encode options = 1 -> PKCS#7 padding, No Base64 Encode (RAW DATA) options = 2 -> No padding, Base64 Encode options = 3 ( 1 OR 2 ) -> No padding, No Base64 Encode (RAW DATA) ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.85.242 (proxied: 108.193.5.232) ---- Manual Page -- https://php.net/manual/en/function.openssl-encrypt.php Edit -- https://main.php.net/note/edit/126267 Del: integrated -- https://main.php.net/note/delete/126267/integrated Del: useless -- https://main.php.net/note/delete/126267/useless Del: bad code -- https://main.php.net/note/delete/126267/bad+code Del: spam -- https://main.php.net/note/delete/126267/spam Del: non-english -- https://main.php.net/note/delete/126267/non-english Del: in docs -- https://main.php.net/note/delete/126267/in+docs Del: other reasons-- https://main.php.net/note/delete/126267 Reject -- https://main.php.net/note/reject/126267 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#216639) next »