3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $salt ='whatever_you_want'; $en= simple_encrypt('data'); echo simple_decrypt($en); function simple_encrypt($text) { global $salt; return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $salt, $text, MCRYPT_MODE_CBC, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_RAND)))); } function simple_decrypt($text) { global $salt; return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_CBC, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_RAND))); }
Output for 7.0.6 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/g0FRh:9 Stack trace: #0 /in/g0FRh(4): simple_encrypt('data') #1 {main} thrown in /in/g0FRh on line 9
Process exited with code 255.
Output for 5.6.7 - 5.6.20, 7.0.0 - 7.0.5
Warning: mcrypt_encrypt(): Key of size 17 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in /in/g0FRh on line 9 Warning: mcrypt_decrypt(): Key of size 17 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported in /in/g0FRh on line 15
Output for 5.2.14 - 5.4.35, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_encrypt() in /in/g0FRh on line 9
Process exited with code 255.
Output for 5.5.34
�'�����&����� &����Ǐ�9,���
Output for 5.5.33
b�+��j�,z8rx�~��~CvmZ�V_BT0
Output for 5.5.32
]V ɌG�'D����<�%D5V�$��Z�Ɣ�#�
Output for 5.5.31
%�ի��ĿQꩢ�:� "- aF��_{s-�:
Output for 5.5.30
��m죙�A�Y�,��Cɟ�mo��u0���,*
Output for 5.5.29
e���/M�ۡ��!(:����l�M؋�!M��k�
Output for 5.5.28
�_l�  \���C�{rn4���ˏ*c��K�Jp
Output for 5.5.27
u��LD�k�v�*�nJ��O�C�R��{�
Output for 5.5.26
��"�/�J�df��(����ОE,��-n�zۃ!
Output for 5.5.25
��{e�C���2�±�Q�Ny��&�=>}�
Output for 5.5.24
j����>#ܒ@�M$�B��n��h� ::��:r��y
Output for 5.4.45
��xܞ��'���K��i���/��P��~z�đ
Output for 5.4.44
귴����T�D�� ;5*��Vy�Y�R��:$��
Output for 5.4.43
�o�{��ey�4�XQ���-\���v\
Output for 5.4.42
W㇆�B�%͢�G�-�j�� �m�n~�0z
Output for 5.4.41
�sc�swE���Zց��_Kl��ͬa<�%�>��
Output for 5.4.40
��So���1�u��t%b<��Ei$U�eq�K
Output for 5.4.39
�T�D鿜�?���I����,�P�43O�� �
Output for 5.4.38
��D��ɺ:{�5 �;r�I(�Vu+�$$Zy�
Output for 5.4.37
�N�!�t ̅W�RB��du4���ͦ*�ԕF�
Output for 5.4.36
�>`��]�!.5�K��~(1+$���?�J�