3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php /** * Keys taken from the phpecc unit tests, but that library's still vulnerable * to several side-channels, so don't use it. */ $private = '-----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDMJFDioKrXm4W7 IR9UMEUwbD1flDal2+CBPMnSgCnq1ELEImJBECr4MzMpfquHXJviFhj2hqNr4/ip X3urjAdas9dSf4Q5VgsPagoDWRmANj7hKEKyFPz1FePE4hM+5SD0aY1NihioOoQ1 +nzKJQXrx1vBTO+hl+ACEnykOiGrCyt6IberUf+CA4yhwrP2Y8ANwJnYLZhO3Zwn NmAWjOOaOp4CjRAEdwzm2Ru8edIZEBEpE0QjIedRJrqmmJnUv035hSBwY5U2xnO5 21sRALELToSomoPt7WNFA3W58xzmg7FhbFJ2QbNI5u55MYPriXJtVZjM8Q34WwGp VxFE/LQZAgMBAAECggEBAKoFaRSHSiLOld/X41bj6Qw+ahNLxwP2kBIzRcg7FC5P 4Nen53tW8uLLCcZ6iHPxrqbrTpksY7l9ImI2czLaKlnhxOkh6UczoXySDYriT3nY NCCkvn/BOTkKpSwaOns8rGjD7HrzFDwwmGK4n+xgT4EjBgmFgWNtsZUoPoUtIVNp ONKSoa7TC0eJU1hdjBbMAjKS5mHiMOQzDACa3CMp8tMqBklBvKuUXGwSdgiVyAa9 iOAv+DdEukcNY/oHiaJlqH/lhBShrSuXD6AFcWLtc5F2VEJYUQNfMfqDIYDXvPZI 5k0FcOXIbSEmvIUj7jqRBzBs5i0eMJggeQsgJaWhJAECgYEA+iK6yaYc+TNNGGg8 ASQxdO49OQ6HWFacSnUJloHbwCWQemUaIbqy71nbeqN4wlXmdO9v9ee5S/yFPWYF zot3LcDQF4iA+0MJWXNGYkBlgwZkGifVSuAGIPWCJQToLWytyYeCOfNCXW3kZNOU Og3Sw7y0c10TITbFJ0KiUq/RIoECgYEA0O2KIes9Qo3IS7QiqUBsP8UzOD4k7Q0y Xu2snN2BY3rVMmWc9sCW+SFK2ybNpVFmwvsU/x0Swt6ESxDvAMz4GV3d5lf+bvKB DK2/9aNPVXCf2qK0jqemEdIpXJUptnyBQE/JkMihP2Hr4Z6rwq5LocMMDx3fbVCv UdFeFO7qlZkCgYEA5Osn2yhFV+OVaQLr93dyM7tdGHytbTFGs/XMoouR25YFVZ51 fezpmZe4/9Hf0Krg0J/Y7Un3EQ23uutF4TNODPdq+j6ZHFrLkaun/H9G59TPhAh0 caP4t+04AD0vZ3MQ0WFM01BHqk3KOmRQQZkpDK4Ez5eczEbdxAJ9oAL7+QECgYB5 gHshiK2io9PE+uhhZ57MY0GLRtCwr0kI3c3RmBvkH44W9fMXqR7jmVHwKxvTNYi+ gchPKLg9bayf/yQPYiQylF001R2ZphwYpH8LOkMr3AiK3K6Ge8bffEojlnegsb11 CjGdqp/jvW2xU1ZuLHC9jTHZJLVH3HFo8op1QBBamQKBgBJTT3pkvAOwh594J4rP dbujWiqq7Jlp4jQjmoA8vcy9Auiy+0cmc1h3eSUQdAatnxLNgDqwHU2cxtbtWSp6 CAG2aZsJVkrMUBiHn2EirD09TER92w85zXx6kpn16qMzHVvo5PR9OcDFg+5xM6br TgvYxFGC/yyTo+1kFaUr9ZvL -----END PRIVATE KEY----- '; $public = '-----BEGIN PUBLIC KEY----- MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE8bjuAc1ucXAA/LbG9i2DSSD8pdgsze34 XPD+ddINq3IR/F7TbNvHJdYLalPIMqm0GJuVB+UGg5duB+921yHYPQ== -----END PUBLIC KEY-----'; $privateKey = openssl_pkey_get_private($private); $publicKey = openssl_pkey_get_public($public); $testParamSignup = array( "email" => 'testdemo3@tpb.com.vn', "password" => 'Tpbank@2017' ); $data = json_encode($testParamSignup); $res = openssl_sign($data, $signature, $privateKey, OPENSSL_ALGO_SHA256); var_dump(base64_encode($signature));
based on E1C9Y
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
string(344) "m8r404O9HTQRnJJtlhC/8qsvLU4rEhoznYxHlqVLXjJD00K4LgI9GYdNckTLG8qOT9Jfq1ljjbWHp7vRoHh1lthxcqUaSOR0CWywInHOZOhcZPUVhQ+9r6R5aUM3OFVqAyUZoCwHr2btcJX17TpK9KF5IFJX9t7UaGFwrBKXwWkKuYyz2n316N2mqFcnpWVhU4twVMqJ6UQEqh5dDSzEED4xcfghYmb/GpnSRA97IvbVZ8ESe71UwV7EWKjshy+3jYS9R48DctaZljr4XoStdxqgRI0l7g3wjbpvfcI/4M8I0yPNf44CBrR0FXaQBylsuQK0S07Y4LqQns36If5XHA=="