3v4l.org

run code in 300+ PHP versions simultaneously
<?php $my_secret = sodium_hex2bin("da93b1db433cfb2efe490a1bb263e440b586b6167c20b86f14cd058515806940"); $my_public = sodium_crypto_scalarmult_base($my_secret); $message = sodium_crypto_box_seal("This is a secret", $my_public); var_dump(sodium_bin2hex($message)); $opened = sodium_crypto_box_seal_open($message, $my_secret . $my_public); var_dump($opened);
based on XovTK
Output for 8.0.3
string(128) "c39f3660cf21e0512faa76aec234b631d0f5ea4bbe3e7730d3318c3e50b9c50f069bf88652d3605e0c224b14527d82a61bbf17bdd87869528448fc3aaeebf0a1" string(16) "This is a secret"
Output for 8.0.2
string(128) "e012bd3899bca046392ba23d629971a27b0300f0f7f045439f1dad7896ed4a7eb72908dcdcaeb9e3c5c75c45510f3ad29c1536e8f0f0b1e83f24ea80ccb59dfd" string(16) "This is a secret"
Output for 7.0.33, 7.1.0 - 7.1.33, 8.0.0
Fatal error: Uncaught Error: Call to undefined function sodium_hex2bin() in /in/Oak7j:3 Stack trace: #0 {main} thrown in /in/Oak7j on line 3
Process exited with code 255.
Output for 7.4.16
string(128) "0a20fd0d2ddd3522c62b4ce2594c5b94e262832c96692b660fd0f62dee52c32c50d4ab697ff08ccdea148d6a0fe9d8f7fd0fcdead370ed0188caf01758cea779" string(16) "This is a secret"
Output for 7.4.14
string(128) "f834b2eeb19e80be8e04a8781a0b8b81ee02a730c8fc47506495b9ad7199e327ee899c939936885cc2df9db8e108656492bad4c63e7185ffbabf775f0fe3ee11" string(16) "This is a secret"
Output for 7.4.13
string(128) "5828970adb19ffd837537f1c9d3297e7be9c073cee0158915eadc2a17ebe2a6f058cc7a56f80e0b5dadeaaf0d59757a1ffe2664f75724d5ab6ddcfeba570e7c1" string(16) "This is a secret"
Output for 7.4.12
string(128) "035afffbe3ef57ee3fa0f8690a47ab420f5229c4f5d1804b23b52745b551c74af793f2e1c5bbf655b72a568051ca189776a318122e47932bc9ea1f090f598427" string(16) "This is a secret"
Output for 7.4.11
string(128) "b32df876bbcab1d32e71c84ce0cbac292951edfd4361dc385d4c2b4d3aee98252a1ab8529264e7f7a97dee3803898f6955d59c93c68ad9c658cc64fc4aebc687" string(16) "This is a secret"
Output for 7.4.10
string(128) "12545d0760b543a69c26c058e2c369dcd4b95d4790578c0266a5ce2bd5f0676f36ba86262ed18c69bd9bdb3f97c4e436eecea7aa9dd28c16ff72404161b2aa06" string(16) "This is a secret"
Output for 7.4.9
string(128) "bd04d4683c966a842fe843fcccadf788692e27e9a9443ac032222af0bd0c65505db309d5f4002aff60acab53ebbeae2ea6c8e05784fccdc677b2132caeb766f2" string(16) "This is a secret"
Output for 7.4.8
string(128) "3a043923533c5d1107929ec983810ae9a4262b97e4ea4da5040934f56b62dc3ab0efd41cec2f6b778d40a14db649ffa12b2539409fe7a37c8e8141e19e206280" string(16) "This is a secret"
Output for 7.4.7
string(128) "b0f3178fae7d4335d1c2d35dcb4b4fc320f205005311e55e185d1b06cbed0d70aac4cb8b77c96ae073244d980244989b30f2c79eb39a60312e3d13471bf30f20" string(16) "This is a secret"
Output for 7.4.6
string(128) "67212c1ccb81ac5ad48d3533e61f4c3be127e61d67ee9032d774e805807a486b561c363f98784ec99e2b25fbbf704f0ab2b3852dd0a7ec12c7ac210511f6882c" string(16) "This is a secret"
Output for 7.4.5
string(128) "56d6fdc467f56d7b5e0c817944aea8063437af071f69e924a0f4016d4ec14d3490a84b4ed48c23811cfaf9420e0d82b66e50dec71b60d3f99c648faaea9159ca" string(16) "This is a secret"
Output for 7.4.4
string(128) "2043e16537e8ba66a641bfe5e09d2f0d0cac817e4eb356a3370d7ddf85390b0eca4af0453943ed13bdaa783c3bbbbadaa384195580e34e4c7f138e9c64ac778a" string(16) "This is a secret"
Output for 7.4.0
string(128) "4266ebff789af77f4a6acee2fdd13b67e876056e9ce361b5e397771829ea2e6ad3f0626badf617758eb17ca3bbe61e5c480d6dd9e468e218e51779a92f69975e" string(16) "This is a secret"
Output for 7.3.26
string(128) "88163b1a721573af9680fd1f6c712f9849d55d82b5fbf7f64dc9dde4cb96200ff642ebbf43b4970510c3ec83d4c84d88323950a002b897af16a055711f511422" string(16) "This is a secret"
Output for 7.3.24
string(128) "1e9d23f5cba07ecd488ebb3286c3fe299a7be597ff13940f09e4aca0a5c8f01c7391deaea0b74c5d259d374fb3096dae6b3eeec29c19a60052da697b2dd68e0f" string(16) "This is a secret"
Output for 7.3.23
string(128) "72485fefb9d598eb474137c81f3d6b62b4b5c08a1040ffc5de57b125a8dbd57c987f868f5dec953b372267a8afa27d28af80d86f6d267f95d199175c423e73fe" string(16) "This is a secret"
Output for 7.3.21
string(128) "553fe19aa7615fc305779f3bd7ea598d0534e71e94b331293d797be2add7b7770df2fc856cfa44295ff59b5a80b06a8e3207492a98e2414208af5c160a7cf89b" string(16) "This is a secret"
Output for 7.3.20
string(128) "613af2d9c2d3c6a6391a931e5661fa9b1b42699b420c3018a536217bf7e60b04785058307d837f12cb72ab818988bb791534bb710a41c24e81853d79c6115342" string(16) "This is a secret"
Output for 7.3.19
string(128) "7a07553449d3ca9294dc7860361b606850767c38465d46031829102f7ee2fa00c2ef3c22b2e0430025d8c5ad1db925b53f2ee1252f1ca91109d1fee2e88be27d" string(16) "This is a secret"
Output for 7.3.18
string(128) "0aa66bf2092ea6d510abf6f95da8cb6f1a33e6797618e16fd8dba64564bf2a2742d67942193a932d66d0e8e8f6ed78eff50db0bec720239b9194b077eba4f9c5" string(16) "This is a secret"
Output for 7.3.17
string(128) "8b3fd21abff548d6df4485152f812f264f8bacf111b36ee7a233d72e42fa2f39a35760c75434db209c982b1e0e23ea204fc05cd884620ae3e73ffa564f71e01c" string(16) "This is a secret"
Output for 7.3.16
string(128) "4330dc9a5678662a58d462f30253a1f739bf5fe0c1efd1f9f3ca671e07d19e0c8daacc07aefe8e39e4ab3d6ee8ac9b3f37c4aede9aa57bb62cce9ba03c021d69" string(16) "This is a secret"
Output for 7.3.11
string(128) "0ccfd59964db68ff9be49a82a74e7465826f3e911a4b931d4728c13b47aa8a11ca60c7821ec8da4fc0c0cd464c2970b1c329da058b29427c77fbe59881922c46" string(16) "This is a secret"
Output for 7.3.10
string(128) "4ee3d87bf34def09903ba29511347e3065b0c08fab86e1574c5cc4ec5706b75a026f58d37902095de1704e5012f3618965f466cf5b0d233c95b32054892fc9a0" string(16) "This is a secret"
Output for 7.3.9
string(128) "6ef4f97e7d8f3852da8939d5a8b872e186933f5ba4646005ed688c1d5614a16a35ab4d772f2348d39970ba91d11d75a7fe7c7fe97f3b117c5c86321672f612a4" string(16) "This is a secret"
Output for 7.3.8
string(128) "82fe686fb808d2406817e8897e598ca9ad760ab98849f29bf1f007588fc83b2d30f18904197c3512dfa5f61099fb5897fc0628711139e93291c59c105d089feb" string(16) "This is a secret"
Output for 7.3.7
string(128) "857ae299236defce3769f5876e9403f79b665524983d0f81490f1f88f8bb09663ad32623f0b64c5705e6f4812a4e98fa146e8c152e22e54f8bdf081a9ed04c47" string(16) "This is a secret"
Output for 7.3.6
string(128) "9996e2dde02c0afad39c55a2e969c63bbbb3067163fa0cfad8b06850f3ef297516bb3b817a0819a836f004f916ba9018cc28d9d0cbe40ead16534b54076b74e0" string(16) "This is a secret"
Output for 7.3.5
string(128) "f5f432488535b69683087de6c417d42be067fee0ff14fecf69dfd674af77a966d687f7d539fc9bd234a2eb0ab605805f9e623fb90792e9f482fa5b8c2e86fe6f" string(16) "This is a secret"
Output for 7.3.4
string(128) "22c213f9aa9e65e4a9b24ccc4208dbb69c0ecd630e6fa64403d0f9653ff67b3d6f76fb642e5d1fafc20111499ed2793cab680faaa0915020a29abeebf30d00b5" string(16) "This is a secret"
Output for 7.3.3
string(128) "549abda5654798ac2d9fba084ead192fc5645c34bbf922127ecc1b194e99046217600e772eaa8a8bd01849a6fbb3d7d86dd1d56057a9e6e29e74f522a702a5bd" string(16) "This is a secret"
Output for 7.3.2
string(128) "5aaadcd5ac35f08723743ed45086a2f19b60025866dfe342c4f642aac55a48159f28070ebfc165a4ac44c87264123173a31c91a794b9f0ede1f50f68f7a94bd9" string(16) "This is a secret"
Output for 7.3.1
string(128) "e1694118667f1af7b332cace45c13e5729cc9748ef6b09b7545e636a53359c63f64f6d1d963cbcbb16779c4dbb947c1a2475bb95a09def8f4de9dee6b2f11573" string(16) "This is a secret"
Output for 7.3.0
string(128) "29cb930f31b52c7cc8651e23ef46b4ecac47c7932bb010d4d519ee2809def8748b71ab951e5673541565781a8a0984c43861644b8963a75b77b4268e65d8bcca" string(16) "This is a secret"
Output for 7.2.33
string(128) "6640de283c39a8e2f5acdc550117082c185911479bb15d8caed4f3afeeb1124bc410b7caf3dffd3e6421fc6c954ecd2fdd6e93680b07531e0b9102ba147aea10" string(16) "This is a secret"
Output for 7.2.32
string(128) "db38c700eb041e8448672a33e5c9697f4aebc5b83e8afff3e8252d7c6ef5334aa1e3991c73f89e7fe53353a237d6ba3fd528adc82a85f4f0ee053a906e50af4e" string(16) "This is a secret"
Output for 7.2.31
string(128) "f20bb0024c7ca4e6a1b888fbef883f89e996a48fcbeae67ea9c564c64430166b1215c56daea6e960d4c49322b26b123f5ae0afd563c5b5fda3ccf0d5a867e404" string(16) "This is a secret"
Output for 7.2.30
string(128) "43925b7bfeda6fb234d8f5b8ec6c88ed13b490567c7054790aa9abb72153ce7a27161b39dfdef91a8f62ddc7fd3e09c6a8dcadf7a96ed42616859198cc7a7fe8" string(16) "This is a secret"
Output for 7.2.29
string(128) "385182ab557644d57fc22bdcba1362936af2011f8a368e933f9f294eb1e9437a754df769bbb8ec5d64ce779c918bddc9731438768a2fbffe54c764ea36256fce" string(16) "This is a secret"
Output for 7.2.24
string(128) "245d4fedc66bca1d30240f2c17aa220a2b534de7de142f2e1d35249dc0938c76aa12c33511fba7120f74ccf850e4b9c36a59c6fdc82649c7a5363b021494a8d1" string(16) "This is a secret"
Output for 7.2.23
string(128) "8237da8f06013effdc88c2f46784ec9198df0e5ab3694071faeea99d8116aa3473a65a8325a4bdacf18a2f5fe249a9074b4189fef404e9a21e4bba961cc16e5b" string(16) "This is a secret"
Output for 7.2.22
string(128) "74b79cd2d4efe5d7276a22ec68edf5aa9dc47c4eb5b47c4454412d5cd70de31452fa329daeb53b16d24582b94d79f13896a4a5f96132d032f82760ba736f6fa3" string(16) "This is a secret"
Output for 7.2.21
string(128) "fa8e88cb7a85f8c307c5e77619eefe39e275ade80b5fc932cf8f615fdd5a3910a26b72a8f1918fd768d2ff6de3cef9dd66273b99da572b4bce07d162c95f4d79" string(16) "This is a secret"
Output for 7.2.20
string(128) "12ff120ca8131bb2a3c60767f39507377cc17a0eb6478def481c3952ccf34b22882a8d21c8884335f647e7c2ec291a16f825391f273640d0686d91f9daf35b31" string(16) "This is a secret"
Output for 7.2.19
string(128) "7a8d175d03c0ecd95d2f3303e2ace7d35f76eddf554c2c45474e66d085cb2e005b8a17715346103f8c9ec96ec36622ae5fcf1515f47670b705f3305897aceeb3" string(16) "This is a secret"
Output for 7.2.18
string(128) "fb888f2d326ac2bb826332bc9669e7370d2c9413ad030269371aaa04b4e0a952dbe9f7b15ca67cd19519b9d5982abcd1eb4ef0ac4f44db3e0b0e125d090eb245" string(16) "This is a secret"
Output for 7.2.17
string(128) "b512f73101b1a20baf0a4ab440ba7380aa815d570b8ddaf6d73a1914f460ef2fd05f802990d54822d36ecb103f3bddbc6197780c90994149c8e65c8a7c8d9019" string(16) "This is a secret"
Output for 7.2.16
string(128) "3389a292b2035893c359cd2d5f6d15ae85cbd03497da9fd85006cc0bb22bb43f6819efde0d57f6edc1bea0bdc91450263e53171c65a0bb5762a29f553061b33d" string(16) "This is a secret"
Output for 7.2.15
string(128) "dea6f518801f5f397cef5eb4ad9efb82688dd1d34ba4e1e849cdb1ab3279d76f6ef68820434b07e13a9fcd423da1d0105e1e26d9cf0936c8e0859645139935b5" string(16) "This is a secret"
Output for 7.2.14
string(128) "ebe2825fd98c232c21c685ffa6b79f9b4a0f85f9205e20b2a2228b4f1ce9350b2a451fa70841c68d361dd55047219037b6a9f7d8c2d20d8ae5378fe127a5ec13" string(16) "This is a secret"
Output for 7.2.13
string(128) "8c1ffb8d8647226367749196a9d4314f9cb35161c3962e4b0080401d536c6900f476cb4425cd82a69fb313c21143e765bcd95838d8e4786a2fe340e1445924f7" string(16) "This is a secret"
Output for 7.2.12
string(128) "add7cc9d72eedd7f7a7ffa6be6f5c7b9a97b775bfe1e134a0b5142a18a66d2424a9893ae890ee037379f4457c3888653696fb98e7167510e6ada78c4961b591c" string(16) "This is a secret"
Output for 7.2.11
string(128) "5fc491dec705a21603490f760d2767e09bb3ecd2a80c144c359f0589a4f53b55eaee88f27c6f5a244c034262a8a15c9a7a8308efb1a74e5586511497f7996a34" string(16) "This is a secret"
Output for 7.2.10
string(128) "95d14bb176a00c351b217fa3892ab3d38541f561e80a12b955cd785167a8a3370e9a92c43aae14cec13b9aca882db7f4542801c3edb38f934185d6e6af59bde2" string(16) "This is a secret"
Output for 7.2.9
string(128) "9736435ecc2cae101d38db245f5b346aca1ba9b6370b211a60b6f5eaaab40421bc7459ef62bbb823d01c6d144dbb30f115a949c6172dd83e0a1b115837177049" string(16) "This is a secret"
Output for 7.2.8
string(128) "d6ab6f722345d2b9356f73b68c8a9fe259b27bcb28189961cadc0284e7c1c86c6991e809e61e08bb6a7d978ca715bdb2804591c2cc75eb6924702ee3772092dd" string(16) "This is a secret"
Output for 7.2.7
string(128) "b4a98d83524cd9922ca51a36c46176c83b7641e37f2461574516d69344814f6f599f331db66ac093b1fef971148f445d817f2b6542c838ff4c773a9b396cb3c0" string(16) "This is a secret"
Output for 7.2.6
string(128) "644bfa4ad0ae2282ff80d34343c2551cc1da868fa4af2659daff604f48e2ee5584f42815a42b7ace9873b4f1709435a5405aa4b2fa13be820666f3c06cdd5442" string(16) "This is a secret"
Output for 7.2.5
string(128) "ad6d820687aa7202e526c0cb730ebab5778061728de79a77f3ba3c3e40d8fe6843df1f702f5fba49d6421a763472eff60a32838b6f0cb3d2d03ec5540729f41d" string(16) "This is a secret"
Output for 7.2.4
string(128) "9d182b7a5c3d14ea936db643378c038730a0673c2575eb592fcc414a69f1cd5a55392db6a72d1cd2813857e8687ae42f594290c111c48121ec5f6cab9b286e72" string(16) "This is a secret"
Output for 7.2.3
string(128) "331f1a5d28a5fdda822e59eaf43a049619f136f77b3901e93bad6d39dbe09c52fc2fd65b23fa1db0d336814a20cd0e486f077f3a6e7ad2b5115e0776ca1a59b7" string(16) "This is a secret"
Output for 7.2.2
string(128) "a0fd60a1647fe8f5a3d1b422324a912cf13b0151718b7abca7cf1f6727f37d30d3f6c26f2fcb6543223d142682690d7f4eb60f5430d577c39b58dacb420517e3" string(16) "This is a secret"
Output for 7.2.1
string(128) "bbbe7b84f772ed121b04d52a34af5d3ba22615beafc46c977c94d9eed8ad0a60b5e2835cf6d576b52a7471f056f51226a0484a5f6c2487727c95353dc20ed67b" string(16) "This is a secret"
Output for 7.2.0
string(128) "220129145d1d3f1c7bd54d864734c98b91dd5076ca75262ed879723d0403817e583151aea2a214765621c74a7152b85d5c395fa022b96c412a786ed36e5cebf4" string(16) "This is a secret"
Output for 5.6.38 - 5.6.40
Fatal error: Call to undefined function sodium_hex2bin() in /in/Oak7j on line 3
Process exited with code 255.