Jump to content

[SOLVED] RHA Encription?


Crew-Portal

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.