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
https://forums.phpfreaks.com/topic/208383-help-with-cryptomethodology/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.