3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $hash = md5('test'); $s =encrypt_blowfish('123123123123', $hash); $w = decrypt_blowfish($s, $hash); echo $s; echo $w; function decrypt_blowfish($data, $key) { $iv = pack("H*", substr($data, 0, 16)); $x = pack("H*", substr($data, 16)); while (strlen($iv) < mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC)) { $iv .= "\0"; } $res = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $x, MCRYPT_MODE_CBC, $iv); return $res; } function encrypt_blowfish($data, $key) { $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $crypttext = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $data, MCRYPT_MODE_CBC, $iv); return bin2hex($iv . $crypttext); }
based on 2dfI1
Output for 7.0.6 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/HTmp1:19 Stack trace: #0 /in/HTmp1(3): encrypt_blowfish('123123123123', '098f6bcd4621d37...') #1 {main} thrown in /in/HTmp1 on line 19
Process exited with code 255.
Output for 7.0.5
83e24260107daa1873e702ef8ca5c0c046a228bbcb477ba2123123123123
Output for 7.0.4
0d72c48a118cac13fa1356a83ab59a92a996e66a3c69c77f123123123123
Output for 7.0.3
ae6e5421a629e8ba527b3ed4727256f41770e27f967cede6123123123123
Output for 7.0.2
62a8a9505ce7e8007f9e78d29187a68c1c94b639509cb38a123123123123
Output for 7.0.1
a67972176292c6ea3d5d02d2525d529898da467654fcbd3e123123123123
Output for 7.0.0
d4f50f819b3a714822c121dd4e9d99f2fdb42c4637e2f28b123123123123
Output for 5.3.18 - 5.3.29, 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_get_iv_size() in /in/HTmp1 on line 19
Process exited with code 255.
Output for 5.6.20
7e0aea1820f2cce574e7dae56b85c80c5b71c326457d2d5b123123123123
Output for 5.6.19
e23ab9f9daecc6448f0be3c44b55cb7ccf9ca2ef033a8e0c123123123123
Output for 5.6.18
339e883d37e78d5656c59c577a03f29a0f3e5a27a65a2aac123123123123
Output for 5.6.17
795b1ae82de8baa1143c7c1c7b974c6c789bb1dbbde270b5123123123123
Output for 5.6.16
399b1c38edb63805ae4b8c5e4b4f061b5d685dbf3450f126123123123123
Output for 5.6.15
8bc1d6af9d09585cd456a467078b829e01a7432d2af90878123123123123
Output for 5.6.14
4f1dec24db0ecef362d94c4400c6fbf2c3e0c7130a7f714e123123123123
Output for 5.6.13
a9484eabca0a815d2aa00b4b1522d32a999e72018be599f9123123123123
Output for 5.6.12
3881c6e038ca9ac6f125c31f2cdbf392b9f0aa722f27d5c3123123123123
Output for 5.6.11
18ddc68e14bc32455d510a4cf9ad398a9c2b21ce47529ad4123123123123
Output for 5.6.10
c74d64c08a2dd40af41560aaee0518260e2d7d789a0d5909123123123123
Output for 5.6.9
c849f7a1d097e73577616c8fcbe4c94437b83c0008102772123123123123
Output for 5.6.8
67f15d7286e96e366d5fe480b2293242282e551ba097cc58123123123123
Output for 5.5.34
0a4ddef8ba6e3757d49d29e46af9949828cd0aa0c5ea5066123123123123
Output for 5.5.33
a29c5add0d045f7ef451e26313f42f060bddcab2ea9ea292123123123123
Output for 5.5.32
949f9c0db8a1afaac754819afea4d4c921ca8a9fd5a42845123123123123
Output for 5.5.31
7d77bf0e5621bb2780b97b5cf4fbdafd3b2de0d9e7e3efb1123123123123
Output for 5.5.30
e5c6fc247e64dab3c0cf105b085fd96506bc2aa507e2e084123123123123
Output for 5.5.29
f548a8273ea4013250ce71ca25d57c5f2c69b5d1f1cd0d1b123123123123
Output for 5.5.28
22810c95a4ebcb32e897079ad940e9f24b66f00230ff2d95123123123123
Output for 5.5.27
9d3a080cb9278e7ae2728e2d04519239ca2dd559ebcaf61d123123123123
Output for 5.5.26
fe9074025c0080375e30233cc82eb16a6c52cfc92d286c62123123123123
Output for 5.5.25
d49196d73ec776699bf14b6607705cbda0419cb65528e68d123123123123
Output for 5.5.24
a3d7a415dda9790e749f2044c801e0af1040982d9169442c123123123123
Output for 5.4.45
9682f6f311805ea3d495f03df3e5672d0ab81a4e68cf0477123123123123
Output for 5.4.44
c02074cb87c7cb7e2cb5aa108b447d4c1ba1b1c938cbac36123123123123
Output for 5.4.43
eb74396aece0cb8e3bfaa53340c8fe31f3e48744cb6031af123123123123
Output for 5.4.42
7d36ea3c711388cc42738868eef9c45bae62c911502630f3123123123123
Output for 5.4.41
1520a0058d8c0fb32507ff0e246a506ce5b9652bf972667d123123123123
Output for 5.4.40
843acecbb28610003d21ec24dd731b1f5a82a8a10259e88d123123123123
Output for 5.4.39
898a250de826a303c0cd66e01e6ea87fd466413900f262ca123123123123
Output for 5.4.38
7ce3566ff35acd990e394341f544342e31157da074a0a226123123123123
Output for 5.4.37
af966266ab44beadc757fa26ea1857dc81562357ded94089123123123123
Output for 5.4.36
79276c7666911d0b861b5c0127c14079e8ecffd46b950acd123123123123
Output for 5.4.35
4256defd76847fe7d83c40da2fd172cb57e5e6ea9ac3a062123123123123
Output for 5.4.34
8e0aae921d6f4c5220c0b57aea428e4dc84b9b26e9a7fb0e123123123123
Output for 5.4.32
d2d0e7434889195db4313fcc1eb766fb45e34c8c67f25031123123123123
Output for 5.4.31
92f1f1d4695d80025cac12479b3573c6136c176c988c68ef123123123123
Output for 5.4.30
51fe88a9af2c9c3abb7674d95eb4f9d0e3d7cbf1091ae91c123123123123
Output for 5.4.29
c20fef2e8c5abc14cdd626c377da8c240259bec1c2b75e1a123123123123
Output for 5.4.28
3a392a6361bacee0ba60790f46fe392426f8540e14853b02123123123123
Output for 5.4.27
43435afcf8abc93ffd520b700c7af87d6987ff8221e8ef51123123123123
Output for 5.4.26
c1400a17185b59dc492c3178d7f51be65d3cd0202e759e27123123123123
Output for 5.4.25
ddb3249700f3a8602bc8eb0e70b769b2989a21904a4d009c123123123123
Output for 5.4.24
a67423fe62926eae43ead7f740f2c598f2a97918ff0d26b2123123123123
Output for 5.4.23
215d717e7de76eee6ea3bcbcaaf1460176804b5d07f259cc123123123123
Output for 5.4.22
3102b7f0895eac4b931078a82d83889ef8f31e6f013a5c16123123123123
Output for 5.4.21
d2b55de7c5243e4a6cd81707597cb54abb9f333df4502a36123123123123
Output for 5.4.20
d6db9812ef61667d943ba2a6c759fa160c0838684f38ac27123123123123
Output for 5.4.19
25ece5d49afbe3cc345e2896fcbc1a2d040bd2948522d0d4123123123123
Output for 5.4.18
2a3fb0d8902a0314a656a9a4298821d95e37dc86bc244626123123123123
Output for 5.4.17
900f752d7d9e2650b7a51df608e32645bd57d6cdf9c363ef123123123123
Output for 5.4.16
4c80c89e6772a8c67b6bbe888218c142617f5adc3ac163e0123123123123
Output for 5.4.15
7c3dc8cba3a278ea9b3a4fc762524721186deb15eafffa40123123123123
Output for 5.4.14
3529b1bedac6ef7491ac99e747e8d6aaaf6fdf512a67aa81123123123123
Output for 5.4.13
bba1dd58c605b0f2dd685b37dda865fe31cec7f307d15fa6123123123123
Output for 5.4.12
a6d3e3792353ea8dfcc154ba7c77fa035d3c7c05dd105984123123123123
Output for 5.4.11
301f10d9a079522d3f8133c07fcc5d494abe76496fd4ca5f123123123123
Output for 5.4.10
006c7dee74d58ab7b40f3846a5646e657b48189227ca8f35123123123123
Output for 5.4.9
7f593e3a75781d47c4f31ceac9a1fdbf3ebdac80de975a38123123123123
Output for 5.4.8
33770d10727d7b98ae6fb11dc6d1e98a7ddd506e7cff9164123123123123
Output for 5.4.7
f6e5ef1e610fc2d50171a08b23b2815d6d96f03a587a1588123123123123
Output for 5.4.6
9313203d98a6800ea923e94f848a627b519aaa852cabe2e6123123123123
Output for 5.4.5
6963c3f290f4f67dee2e91dcc9988e0f03b6b5e856541b3f123123123123
Output for 5.4.4
cacd646084995af17c29863b332b9f8efcf49215b0bbc956123123123123
Output for 5.4.3
c0b06e31577c492868c7e61a58203f1f043c5a74b3f5123a123123123123
Output for 5.4.2
e61a4212f0f855db47ff43aa490036d1d99837ef737bb4c5123123123123