简体   繁体   中英

How to encode url in base64 that no body can decode it

I want to encode my urls in base64 and decode it in my functions and no body can decode it how can i do this.

<?php
$somestring = 'here is my some string';
$url = 'http://google.com/'.$somestring;
base64_encode($url);
?>

Base64 is not meant for encrypting sensible data. It's merely a means of representing data in another way. What it does, it takes binary data and converts it to ASCII, so that binary data can be represented with ASCII characters.

If you want to encrypt strings like your URLs, you have to choose an encryption algorithm like Blowfish, which is available in the PHP bcrypt extension.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM