Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function XOREncryption($InputString, $KeyPhrase){
- $KeyPhraseLength = strlen($KeyPhrase);
- for ($i = 0; $i < strlen($InputString); $i++){
- $rPos = $i % $KeyPhraseLength;
- $r = ord($InputString[$i]) ^ ord($KeyPhrase[$rPos]);
- $InputString[$i] = chr($r);
- }
- return $InputString;
- }
- Key = generateSecretKey( 'AES' , 128 )
- EncryptedText = encrypt( Text , Key , 'AES' , 'Hex' )
- Text = decrypt( EncryptedText , Key, 'AES' , 'Hex' )
- <cfset var strHash = Hash(arguments.hashstring,"SHA-256") />
- hash('sha256', $strKey);
- byte[] data = new byte[DATA_SIZE];
- byte[] result;
- SHA256 shaM = new SHA256Managed();
- result = shaM.ComputeHash(data);
Add Comment
Please, Sign In to add comment