jackhad
(Jackhad)
1
I use this to encrypt my $id
$encrypted = utf8_encode(Yii::$app->security->encryptByKey($id, $key));
it displays like
þ@FN_ßcU6Y3758ce74fecf8a9c355f4ea3bd31d9a1daeda79ecd17aa85b40962a4c51675f70ïó+ýËTaJpiȹsÅå ÓZt
but i dont want this junk chars…I need a clean alphanumeric+special chars with limited chars are enough.where do i need to customize this?
samdark
(Alexander Makarov)
2
You can use base64_encode() and base64_decode() to get ASCII chars.
1 Like
jackhad
(Jackhad)
3
Hi samdark
Thanks for your reply.
I use this base64_encode($encrypted) but the chars are very lengthy any options to define this? like
base64_encode($encrypted,16) // generates 16 chars
samdark
(Alexander Makarov)
4
Well, that’s correct. Encryption in Yii is quite strong so resulting string is lengthy. What do you need it for?