Simplehost Web Hosting

AES Encryption

Input text
Key
Pad Character
Block Size: 16
..........
Result (Printable base64 representation of binary data)
Mode:


PHP Code:

<?php
	$source 	= 'Secret password.';
	$key 		= 'Private encryption key';
	$td 		= mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
	$iv 		= mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM);	
	mcrypt_generic_init($td, $key, $iv);
	
	//Encrypt the data, returns as encrypted binary data
	$encrypted_source = mcrypt_generic($td, $source);
	
	//Decrypt the data, parse in binary encrypted data, returns plain text string
	$decrypted_source = mdecrypt_generic($td, $encrypted_source);
	
	mcrypt_generic_deinit($td);
	mcrypt_module_close($td);
?>

 

base64 | MD5 | SHA1 | SHA256 | AES 256 | Blowfish | 3DES

Recent News
Feb 13, 2016

We have deployed PHP 7.0 to selected servers which has up to 4x performance gain on previous versions as well as the most comprehensive language API available. Read More


Feb 08, 2015

Bitcoin payments are now accepted for all hosting products. Bitcoin payments are simple, fast and simple to do on a mobile device. Get your digital wallet today and pay with Bitcoin. Read More