Crew-Portal Posted December 4, 2007 Share Posted December 4, 2007 Hello I am fairly new to making functions in PHP and I was wondering if someone could help me out. I would like to create 2 functions named: RHA.en RHA.de The first one RHA.en will take a string and encrypt it, like: RHA.en("Hello My Name Is Bob!"); Which will produce "GFH8T95UGIG80W034UG0458" And the second function RHA.de will take an encrypted string and decrypt it, like: RHA.de("GFH8T95UGIG80W034UG0458"); Which will produce "Hello My Name Is Bob!" Does anyone know how i would go about making an encrypted string that is recognized in a mathamatical algorithim so it can be decrypted one encrypted. I was thinking something like an array of some sort. If someone could write up the code for me or give me a tutorial link for doing such a thing I would be really appreciative! Link to comment https://forums.phpfreaks.com/topic/80064-solved-rha-encription/ Share on other sites More sharing options...
mrdamien Posted December 4, 2007 Share Posted December 4, 2007 Well, since I don't know what this is for I'll just start by saying, encryption is not a reliable way to protect info. 1) PHP offers some premade functions http://ca.php.net/base64%20encode http://ca.php.net/manual/en/function.base64-decode.php <?php echo base64_encode('This is an encoded string'); //VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw== ?> <?php echo base64_decode('VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='); //This is an encoded string ?> 2) Making your own encryption scheme (a good one) takes a lot of math skills (that I don't have). Link to comment https://forums.phpfreaks.com/topic/80064-solved-rha-encription/#findComment-405716 Share on other sites More sharing options...
Crew-Portal Posted December 4, 2007 Author Share Posted December 4, 2007 Sweet thanks! Link to comment https://forums.phpfreaks.com/topic/80064-solved-rha-encription/#findComment-405757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.