Jump to content

Help with Cryptomethodology.


Jragon

Recommended Posts

Hello People,

 

I need a little help in making my own encryption thingy. It wont be used for sucuraty I'm just doing this so i can broden my knowage of php.

 

What my encryption will do:

 

QAZ = WSX

WSX = EDC

EDC = RFV

RFV = TGB

TGB = YHN

.

.

.

 

 

I was wondering if someone could point me in the right direction?

 

Thanks

 

Jragon

Link to comment
Share on other sites

This is what i have done so far:

<?php
function crypty($string){
    $search  = array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm');
    $replace = array('W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'V', 'B', 'N', 'M', ' ', 'Q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a' 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'q');
    $subject = $string;
    $output = str_replace($search, $replace, $subject);
    return $output;
}
$encypt = 'Hello'
echo crypty($encrypt);
?>

but there an error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in C:\xampp\htdocs\cript.php on line 4

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.