php script to encrypt an input

Solutions on MaxInterview for php script to encrypt an input by the best coders in the world

showing results for - "php script to encrypt an input"
María
28 Oct 2016
1function encrypt_decrypt($string, $action = 'encrypt')
2{
3    $encrypt_method = "AES-256-CBC";
4    $secret_key = 'AA74CDCC2BBRT935136HH7B63C27'; // user define private key
5    $secret_iv = '5fgf5HJ5g27'; // user define secret key
6    $key = hash('sha256', $secret_key);
7    $iv = substr(hash('sha256', $secret_iv), 0, 16); // sha256 is hash_hmac_algo
8    if ($action == 'encrypt') {
9        $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
10        $output = base64_encode($output);
11    } else if ($action == 'decrypt') {
12        $output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
13    }
14    return $output;
15}
16 
17echo "Your Encrypted password is = ". $pwd = encrypt_decrypt('spaceo', 'encrypt');
18echo "Your Decrypted password is = ". encrypt_decrypt($pwd, 'decrypt');
19
Woody
17 Oct 2018
1 dycrypt password 
queries leading to this page
php crypt encrypt decryptencrypt decrypt phphow to encrypt and decrypt password in php mysqlencryption and decryption in phpphp decrypt string encrypted in codeinger 4php how to decrypt passwordhow to encrypt string and decrypt string in phphow to encrypt and decrypt password phpsalt based encrypt and decrypt using phpwhat other methods can i use to encrypt and decrypt a string using phpbest encrypt decrypt phpencrypt and decrypt password in core phpdecrypt to encrypt php onlinephp encrypt decryptphp encrypt and decrypt dataaes 256 php save encryption key as texthash encrypt decrypt phpphp ecrypt and decryptdecrypt with phpphp encrypt stringhow to decrypt an encrypted code phpphp encrypt decrypt stringhow to encrypt and decrypt a string in phpphp basic encryption decryption functionjsencrypt php decryptphp simple 10 encrypt and decryptphp simple encrypt and decrypt algorithmphp encrypt decrypt passworddecrypt function in phpsimple encryption and decryption in phphow to decrypt php hashencryption and decryption in php examplehow to encrypt decrypt data in phpmcrypt encrypt php 7encrypt in php and decrypt in jsfunction encrypt decrypt password phpjava encrypt decrypt in phpphp openssl encrypt decrypt stringencrypt a string using decrypt key in phpdecrypt and encypt in phpencryption in javascript and decryption in phpdcrypt and encrypt in phpencrypt and decrypt php 7how to encrypt and decrypt password in php using hashencrypting and decrypting data in phpbcrypt encrypt and decrypt php php encrypt decrypt integerphp crypt decryptphp mcrypt decrypt examplephp code for aes encryption and decryptionhow to make encryption in php string and decryptphp encrypt message crypt 28 29 decryptphp encrypt and decrypt functionencrypt decrypt phpencrypt and decrypt text messages in pure php codephp hash encrypt and decrypt phpphp encrypt decrypt intdecode and encode messages decrypt and encrypt phpencrypt and decrypt a string in phpphp encrypt aes and java decryptrijndael encryption php 128 by 16php strong encryptions for stringsphp encrypt and decrypt arrayencryption in phpencrypt and decrypt password phpohow to encrypt and decrypt string in phpdecrypt php function simplecore php password encryption and decryptionphp mcrypt encrypt php 7php script to encrypt an inputphp encrypt decrypt functionphp response encrypted payload how to decryptencrypt decrypt id in phpencrypt in c 23 and decrypt in phpphp encrypt and decrypt passwordrijndael 256 cbc 7 paddingdecrypt encrypt phphow to hash and unhash a string in phpencryption and decryption of data in phpphp decrypt and encrypt stringhow to encrypt and decrypt message in phpdecrypt php passwordmake an encryption and decryption in phpencryption and decryption in php class phpcrypt php decryptencrypt decrypt php classhow to decrypt php passwordencrypt and decrypt file phpencrypt decrypt php javascriptphp encrypt decrypt with keyencrypt decryt phpopenssl encrypt and decrypt string phpencrypted to plain text in not working phphow to decrypt encrypted php codephp function to encrypt and decryptsimple php encrypt decryptphp how to encrypt text with a saltphp decryptencrypt value in phpencrpt decrypt phphow to encrypt password and then decrypt password in phphow to encrypt and decrypt integer in phpphp rijndael encrypt 2fdecryptphp encrypt decrypt tutorialhow to encrypt data php and automatically decrypts themphp encrypt decrypt string simpleencrypt in javascript and decrypt in phpaes ciphertext decryption information in php with iv and salt lengthphp crypt function decryptencryption and decryption algorithm in phphow to encrypt and decrypt in phpencryption and decryption phpencrypting and decrypting php pass decryptor in phpencrypt file in folder php and decryptphp two way encrypt decryptphp encrypt message encrypt 28 29 decryptopenssl encrypt phpphp encode with keyencrypt decrypt php 7encrypt and decrypt data in php ciphertext in fucntion doesnt work but out fo fucmtion does phpphp mysql encrypt decrypt dataencryptit phpdecrypt php functionpassword encrypt and decrypt in phpphp encryptedphp encrypt encryptphp encrypterbcrypt encryption phpopenssl encrypt and decrypt phphow to encrypt and decrypt password in phptools to perform aes 256 encryption phphow to do encryotion and decryption in phpaes encryption and decryption in phpencrypt with java and decrypt with phpaes decryption in phpencripted to text in phpencrypt and decrypt in phpciphertext in function doesn 27t work but out of function does phpphp simple encryption decryptionphp encrypt decrypt textcrypt and decrypt phpmessage encrypt and decrypt in phpphp encrypt decryptopenssl encrypt decrypt phpdecrypt crypt password phpsah1 decrypt in phpdecrypt phpphp in encript by text not workingdecrypt in phpencrypt phpphp crypt to stringaes encrypt decrypt in php with saltencrypting and decrypting in phphow to encrypt in phpphp code encrypt to decrypt onlinepassword decryption in phpphp encrypt decrypt for urlphp password encryption and decryptionhow to encrypt and decrypt id in phpencrypt and decrypt using phpphp decrypt aesphp encrypt and decryptphp password decryptfast random encryption in phpwhen i decrypt php it gives me something elsehow does php deal with incorect cipher keysencrypted decrypt in phphow to decrypt phpphp decrypt string with keyencrypt decrypt php onlineencrypt decrypt password phpjs encrypt php decrypthow to encrypt and decrypt a password in phpphp string encryption and decryption 3ffunction encrypt decrypt phphow to re encrypt phpencrypt decrypt in phpphp encrypt and decrypt back to textencrypt in php and decrypt in phpmcrypt decrypt phpencrypy messages phpencrypt and decrypt file php libraryphp encryption and decryption codephp string encryption and decryptionencrypt and decrypt password in phpsimple string encrypt decrupt phpphp encrypt decrypt vs rcedecrypt crypt 28 29 in phpphp encrypt and decrypt functionsencryption decryption in phppassword encrypt decrypt phppassword decrypt phphow to encrypt decrypt in phpencrypt and decrypt id in phpcrypt decrypt string phpphp encryptionsimple encrypt decrypt phpphp simple encrypt decryptphp encrypt and decrypt textphp openssl encrypt and decrypt exampledecrypt encrypted file phpphp how to encrypt and decrypt dataphp encryptwhat is the best way to encrypt and decrypt password in phpphp aes encrypt 2f decrypthow to encrypt and decrypt string in php5 php decryptphp encrypt decrypt with saltencrypt 2fdecrypt data phpphp encrypt 2fdecryptencrypt decrypt function in phpandroid encrypt decrypt in php encrypted data 2f 2fdecrypt function function decryptthis 28 24data 29 7b phphow encrypt and decrypt password in phpphp simple password encrypt decryptword encrypter and decrypter phphash decrypt phphow to encrypt and decrypt a php string 3fcrypto encrypt and decrypt in phpcrypt 3a 3adecrypt phpandroid php encrypt decryptphp encrypt decrypt lengthhow to decrypt a string in php encryptionencrypt and decrypt password in php mysqlhow to securely encrypt and decrypt in phpmake encrypted of length 32 phpaes encryption phpphp encrypt decrypt filesencrypt decrypt file phpphp ecrypt and decrypt passwords 24ciphertext 3d base64 encode 28 24ciphertext 29 3b add salted hash with this in phpphp mcrypt decryptencrypt and decrypt phppassword encryption and decryption in phpencrypt and decrypt string in phpcore php password encryption and decryption codemake custom encrypt decrypt in phpencrypt decrypt text phphow to make text encrypt and decrypt phpphp text encrypt decryptencrypt in js and decrypt in phphow to encrypt decrypt string phpdecrypt 28 29 phpcrypt encrypt phpdecrypt password com encrypt phpphp encrypt decrypt idhow to decrypt in phpdecrypt crypt function in phphow to encryot decrypt php with keyencrypt and decrypt number in phpreplace php encrypt decryptcara encrypt decrypt phpencrypt in php and decrypt in c 23easy php encryption decryptiondecrypt php codephp password encrypt and decryptdecrypt crypt function phpsecure way of encrypt 2fdecrypt password in phpencryption and decryption php projecthpw decrypt encrypted password in phpencrypt password phpstr encrypt phpencrypt phpphp simple encrypt and decryptdecrypt data phpencrypt text like phpencrypt in jquery and decrypt in phpencryption phpencrypt password in windows form 2c decrypt in phpphp encrypt and decrypt an objectphp encrypt decrypt examplephp code to encrypt and decrypt passwordcrypt and decrypt url to 32 characters phphow to incrypt decrypt in phpjavascript encrypt php decryptphp encrypt and decrypt with public keyphp encrypt decrypt onlinephp encryption decryptionhow to make a php encryption and decryption codesimple encrypt decrypt hash protect phpencryption and decryption password in phpphp openssl encrypt decrypt examplephp hash encrypt decryptssl encryption php examplephp file decryptopenssl decrypt phpencrypt and decrypt function in phpphp script to encrypt an input