simple and easy php encryption and decryption

View previous topic View next topic Go down

simple and easy php encryption and decryption

Post by jamied_uk on 27th October 2013, 01:36

Code:

<?php


// its a good starting point add your own added security / padding /  salts!
//Key
$key = 'SuperSecretKey';

//To Encrypt:
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, 'I want to encrypt this', MCRYPT_MODE_ECB);

//To Decrypt:
$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB);



echo $encrypted;
echo $decrypted;
?>
avatar
jamied_uk
Admin

Posts : 2022
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum