3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * PHP mcrypt - Basic encryption and decryption of a string */ $string = "Some text to be encrypted"; $secret_key = "This is my secret key"; // Create the initialization vector for added security. $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND); // Encrypt $string $encrypted_string = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $secret_key, $string, MCRYPT_MODE_CBC, $iv); // Decrypt $string $decrypted_string = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $secret_key, $encrypted_string, MCRYPT_MODE_CBC, $iv); echo "Original string : " . $string . "<br />\n"; echo "Encrypted string : " . $encrypted_string . "<br />\n"; echo "Decrypted string : " . $decrypted_string . "<br />\n"; ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in /in/caCEc:9 Stack trace: #0 {main} thrown in /in/caCEc on line 9
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.5.35 - 5.5.38, 5.6.0 - 5.6.30
Fatal error: Call to undefined function mcrypt_create_iv() in /in/caCEc on line 9
Process exited with code 255.
Output for 5.5.34
Original string : Some text to be encrypted<br /> Encrypted string : *�2#���s2�d٘_|�[��|�8��6F�~�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.33
Original string : Some text to be encrypted<br /> Encrypted string : �]^Oc>"vP ���fE�XD���Զ�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.32
Original string : Some text to be encrypted<br /> Encrypted string : @�Q4��GW�.}XK:��)\�؜�1@#Xq�G<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.31
Original string : Some text to be encrypted<br /> Encrypted string : 2�]�w)��CY!�k%��Q���)�Zg���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.30
Original string : Some text to be encrypted<br /> Encrypted string : C�6��ɟ�Q(i��,2?��&� �`r��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.29
Original string : Some text to be encrypted<br /> Encrypted string : ��o�5 )�+����qٯ쮳2�d�ڳ�8�(�f<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.28
Original string : Some text to be encrypted<br /> Encrypted string : �*KD�h���:�[�' r�}�f��P�=�����<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.27
Original string : Some text to be encrypted<br /> Encrypted string : �j�<>Wc�.�B�gl V�-����=<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.26
Original string : Some text to be encrypted<br /> Encrypted string : ~IwM;[P!�ms�w��r&zP��� ��1<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.25
Original string : Some text to be encrypted<br /> Encrypted string : � ��k����SI��i0u��gl�Q��p^\�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.24
Original string : Some text to be encrypted<br /> Encrypted string : RBhI� �ۿ��__meb�V�%UB��lt �r<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.23
Original string : Some text to be encrypted<br /> Encrypted string : �4��j���8;�ٙ�����8�b�]+�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.22
Original string : Some text to be encrypted<br /> Encrypted string : �lR��w+:?��I �e��+���|��<t�z-�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.21
Original string : Some text to be encrypted<br /> Encrypted string : a/�\���U����"�W`�� �vf��פb�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.20
Original string : Some text to be encrypted<br /> Encrypted string : m����b:Dω�CZ�rG� ��p�*�ON��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.19
Original string : Some text to be encrypted<br /> Encrypted string : <���>q��Թ��xe\ �r?�w��z�8��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.18
Original string : Some text to be encrypted<br /> Encrypted string : �E�u�n�d�*r`�`�Z)I��\N��=<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.16
Original string : Some text to be encrypted<br /> Encrypted string : ⧣)g5����0�?�^倭�����xT:�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.15
Original string : Some text to be encrypted<br /> Encrypted string : LS�ğ��#�v��p3����_��\�"?�2�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.14
Original string : Some text to be encrypted<br /> Encrypted string : �!�=����{W'��UH�����1<����*<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.13
Original string : Some text to be encrypted<br /> Encrypted string : ����k5KKڱ|�2~$�8�$q��k��b��D<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.12
Original string : Some text to be encrypted<br /> Encrypted string : ��z��d\2���0*$I�.�ۈ��*[B�|0<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.11
Original string : Some text to be encrypted<br /> Encrypted string : 2�i����%�.�[�X� ��W�"[ 4<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.10
Original string : Some text to be encrypted<br /> Encrypted string : �4Y�)�ތ�2K��`��CQ)i]�*]���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.9
Original string : Some text to be encrypted<br /> Encrypted string : ����ilE�T��e"e�U"w��}k�QC��E<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.8
Original string : Some text to be encrypted<br /> Encrypted string : �j�E�m�Y��y0/�[M{2B�'�<ܷ/�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.7
Original string : Some text to be encrypted<br /> Encrypted string : UjN{��p�{���\���HӮ�� 60 ��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.6
Original string : Some text to be encrypted<br /> Encrypted string : �6���|����k�8��I�<�A�\�����<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.5
Original string : Some text to be encrypted<br /> Encrypted string : ���a�"���_�B��I<��YAt� ��H9<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.4
Original string : Some text to be encrypted<br /> Encrypted string : �9q�o� {��;�"����%�� ���e<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.3
Original string : Some text to be encrypted<br /> Encrypted string : Л~A�WL�G5{.��ƴ�m�|_�:��bu8�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.2
Original string : Some text to be encrypted<br /> Encrypted string : �jV�����㘷.�U�zP�Fx��q�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.1
Original string : Some text to be encrypted<br /> Encrypted string : �ր�7喀o�5�b�L��|ƃ`u)��tz�ڿ�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.5.0
Original string : Some text to be encrypted<br /> Encrypted string : �|��A��� ����υ|��M���9\�P|<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.45
Original string : Some text to be encrypted<br /> Encrypted string : ��ݫ+NoN�Ϲ �[�]�k�A|sU��d�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.44
Original string : Some text to be encrypted<br /> Encrypted string : KA���������[��O��G0��Y���/�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.43
Original string : Some text to be encrypted<br /> Encrypted string : �D���JI�K�.��,R4�E����>X��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.42
Original string : Some text to be encrypted<br /> Encrypted string : ^�]��~a�t��¿@��z���� ��cQ�B�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.41
Original string : Some text to be encrypted<br /> Encrypted string : ��}���s�wfg��L�g瑯 �8���!�c1 2<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.40
Original string : Some text to be encrypted<br /> Encrypted string : &�o={�����\(n�8� 4JAHS7�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.39
Original string : Some text to be encrypted<br /> Encrypted string : �ħ����&��}ĭzIa8����A;���4r�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.38
Original string : Some text to be encrypted<br /> Encrypted string : "|YYo^�;5�؁�J0��gb�\c��I���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.37
Original string : Some text to be encrypted<br /> Encrypted string : �E2�f����;�u�K�(_`uvKK�C�C�;�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.36
Original string : Some text to be encrypted<br /> Encrypted string : '�����;�����(>�n`*�i����}X�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.35
Original string : Some text to be encrypted<br /> Encrypted string : ��K���%���ieD:���1��ZZ�1���x<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.34
Original string : Some text to be encrypted<br /> Encrypted string : ��H�7m}�4319��ݲ�/>��#�y�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.32
Original string : Some text to be encrypted<br /> Encrypted string : SQ;U�?�G�R���_�%g,{8���4O><br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.31
Original string : Some text to be encrypted<br /> Encrypted string : e� �&�s�OA �$`���b�ca�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.30
Original string : Some text to be encrypted<br /> Encrypted string : ��:Dm0"�1 �g���T�Xt�� ��<�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.29
Original string : Some text to be encrypted<br /> Encrypted string : 7H$�'�029���W� ,$obC�c��7�U?3<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.28
Original string : Some text to be encrypted<br /> Encrypted string : ����TG0�<�z��z[,�Ά��@N���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.27
Original string : Some text to be encrypted<br /> Encrypted string : �؇�5��:�'gF[*\�~}�{1� Й�U�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.26
Original string : Some text to be encrypted<br /> Encrypted string : n0K��1�9Y��U�Ώ0ʊ5D:ȒA�� ��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.25
Original string : Some text to be encrypted<br /> Encrypted string : }X4N6U�S�� .C\�L�vN���s=<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.24
Original string : Some text to be encrypted<br /> Encrypted string : (2w���N�P �9�fQ�/��ok��� l�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.23
Original string : Some text to be encrypted<br /> Encrypted string : p՗�ki2��Y�2�tj������4a�q��J!<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.22
Original string : Some text to be encrypted<br /> Encrypted string : �&)=���=�Ϫrw)Ԝc�`�7��7�/�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.21
Original string : Some text to be encrypted<br /> Encrypted string : ���C"2.(u�/!�H-���|*�/��]�L�R�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.20
Original string : Some text to be encrypted<br /> Encrypted string : �F�_�G��p�"���stҺ ���10�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.19
Original string : Some text to be encrypted<br /> Encrypted string : `s� I��}�5�;T��B�.�9#��Zʫ-g��s�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.18
Original string : Some text to be encrypted<br /> Encrypted string : �B�<3H*$�4�#�mҴ�����[�(<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.17
Original string : Some text to be encrypted<br /> Encrypted string : �MԜ��@nq��)�����J�b2�60g���{�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.16
Original string : Some text to be encrypted<br /> Encrypted string : �R T@ �n�(��;�2"���?k�gF�2/<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.15
Original string : Some text to be encrypted<br /> Encrypted string : �� �&���Z��|�0{��{ti^�A�n�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.14
Original string : Some text to be encrypted<br /> Encrypted string : O�{1�����Ij����Ir��>�J�L<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.13
Original string : Some text to be encrypted<br /> Encrypted string : �>dY��AU;D�0� .v��o�q��v� ӑ��<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.12
Original string : Some text to be encrypted<br /> Encrypted string : D׆���"Z�e�� )�;7��@w�>�8I<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.11
Original string : Some text to be encrypted<br /> Encrypted string : �t">}�R���AYC���8�7N�[�n/n�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.10
Original string : Some text to be encrypted<br /> Encrypted string : ��E<�Md ��N|J��aF:TQY5u�ǘ<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.9
Original string : Some text to be encrypted<br /> Encrypted string : �j���U�Q����|v帪�����7� E���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.8
Original string : Some text to be encrypted<br /> Encrypted string : ;'��l��\4'6��N�,o�= ˚�z�l<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.7
Original string : Some text to be encrypted<br /> Encrypted string : E�W ��e��?Hz�:�Gy T�� ���E���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.6
Original string : Some text to be encrypted<br /> Encrypted string : ����4l��je�eE>^�Ї{��Rpa�6Rp�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.5
Original string : Some text to be encrypted<br /> Encrypted string : � �筥��,*7�D� Y���7�iV���%<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.4
Original string : Some text to be encrypted<br /> Encrypted string : �\�: ��#s��N�e�2uV�'��/8of�v5<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.3
Original string : Some text to be encrypted<br /> Encrypted string : ��mB{�U�B�e=�[y�5���{!���ߧ�<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.2
Original string : Some text to be encrypted<br /> Encrypted string : $���qQ�[+4.By^���</�!�C`Z���<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.1
Original string : Some text to be encrypted<br /> Encrypted string : �q��b��?�@���42�s�"ꭌQ�bd����<br /> Decrypted string : Some text to be encrypted<br />
Output for 5.4.0
Original string : Some text to be encrypted<br /> Encrypted string : �Q�2}o�5S$U!� �"��} �<-:�8�<br /> Decrypted string : Some text to be encrypted<br />
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: mcrypt_create_iv() in /in/caCEc on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: mcrypt_create_iv() in /in/caCEc on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: mcrypt_create_iv() in /in/caCEc on line 9

preferences:
352.61 ms | 401 KiB | 415 Q