1

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.

1
  • The encrypted data in CI comes out as binary, to convert it to a string, the data is Base64 encoded. Commented May 14, 2013 at 3:24

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

-1

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

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

1 Comment

i wanted to decode this back by the way so i need this to be reparsed. :D

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.