User Tools

Site Tools


uphp:functions:aes_decrypt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
uphp:functions:aes_decrypt [2019/08/16 06:41]
admin [See Also]
uphp:functions:aes_decrypt [2019/08/16 08:24]
admin
Line 76: Line 76:
   $base64_decrypted = base64_decode($base64_encrypted);   $base64_decrypted = base64_decode($base64_encrypted);
      
-  // we will use the calculated length from the encryption as the strlen() function +  // we will calculated the length from the base64 string rather than the encrypted  
-  // may not yield a valid result if the encrypted string has a zero in it.+  // one as the strlen() function may not yield a valid result if the encrypted string  
 +  // has a zero in it.  As base64 is 6 bits and our data is 8, we just need to multiply  
 +  // the the length by 6/8 or 0.75 to get the base64-decoded size. 
 +   
 +  $len = intval(strlen($base64_encrypted) * 0.75);
      
   // decryption  routine   // decryption  routine
uphp/functions/aes_decrypt.txt · Last modified: 2021/09/13 05:57 (external edit)