1
votes

just wanted to verify if on Codeigniter Encryption say like this one

hhNa0fUcOc3k0jUhPcRBJshpiXLpUSug+NhgPk89O7eSjerHk6go360U9rl8LazZo6DR6M1N4IqG0PYIwPyKhQ==

Is the structure of this string always have a '+', '=' and a '/' character?. Just wanted to verify things before i parse them. Is there a case wherein when a string is encrypted it may contain special character other than '+, =, /' signs? Just a heads up, i didn't used any mcrypt thing other than the default specified on CI.

2
The encrypted data in CI comes out as binary, to convert it to a string, the data is Base64 encoded. - cryptic ツ

2 Answers

2
votes

This seems like a base-64 encoded string. + and / are valid characters, and = are padding which will always show up on the end. +, / and = are the only special characters in a standard base-64 implementation.

-1
votes

use this to remove = from the encoded string while using base64_encode

<?php echo  rtrim(base64_encode($content_string),'=') ?>