3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is a demo, decrypting a string which was encrypted here: https://repl.it/BhjH // CAUTION: This is a 512 bit RSA demo key - NEVER USE THIS SOMEWHERE FOR REAL! $private_key_string = <<<__EOF__ -----BEGIN RSA PRIVATE KEY----- MIIBOwIBAAJBANWj431rbsGw3f6rmED2gN0sKaxxDGvFB/M+o6OwnHGEtz7tL1bz J3wUEHzUkt4EelafK7KHNfOZ45mwmeviPn8CAwEAAQJAYj3oKc+Scf1cSHUuIYl5 fruFOmgN9yz21/ORGn/noQc4HS04VynMhzojs5MVIGTFVW1KTn8L4CdQ9iIHHPO4 SQIhAPkb7XKPrCif9XnJSa8l2roMzBYbUXQeeMHW46OzehGlAiEA24zJgypJ3F8t FLqRwXLH0eMr1D50vbPWcmeAWx5hjlMCIQCtPIa8jL2k4tjLgPgFHcYmbI/hL85N eoNwCgj05vOVIQIgScOUlNgpdrwXhmZkwE0TK8aanDXbvTzl6QwzSOn9NvcCIQCS zYIZywZTRueYk3YQCTX3ofnQad7M9X2802tWqm0q6A== -----END RSA PRIVATE KEY----- __EOF__; $private_key = openssl_pkey_get_private($private_key_string); $encrypted_encoded = "WetPszXfBK3iJgvOh0Wst+j7hBEJbYNGCmR+bgZZNglNsHTBh/ewVS04XpyJUnMTgjvLSoPaCbQ1SIpxJh7eXg=="; $encrypted = base64_decode($encrypted_encoded); openssl_private_decrypt($encrypted, $decrypted, $private_key); echo "decrypted: $decrypted\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3NKcb
function name:  (null)
number of ops:  20
compiled vars:  !0 = $private_key_string, !1 = $private_key, !2 = $encrypted_encoded, !3 = $encrypted, !4 = $decrypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '-----BEGIN+RSA+PRIVATE+KEY-----%0AMIIBOwIBAAJBANWj431rbsGw3f6rmED2gN0sKaxxDGvFB%2FM%2Bo6OwnHGEtz7tL1bz%0AJ3wUEHzUkt4EelafK7KHNfOZ45mwmeviPn8CAwEAAQJAYj3oKc%2BScf1cSHUuIYl5%0AfruFOmgN9yz21%2FORGn%2FnoQc4HS04VynMhzojs5MVIGTFVW1KTn8L4CdQ9iIHHPO4%0ASQIhAPkb7XKPrCif9XnJSa8l2roMzBYbUXQeeMHW46OzehGlAiEA24zJgypJ3F8t%0AFLqRwXLH0eMr1D50vbPWcmeAWx5hjlMCIQCtPIa8jL2k4tjLgPgFHcYmbI%2FhL85N%0AeoNwCgj05vOVIQIgScOUlNgpdrwXhmZkwE0TK8aanDXbvTzl6QwzSOn9NvcCIQCS%0AzYIZywZTRueYk3YQCTX3ofnQad7M9X2802tWqm0q6A%3D%3D%0A-----END+RSA+PRIVATE+KEY-----'
   17     1        INIT_FCALL_BY_NAME                                       'openssl_pkey_get_private'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !1, $6
   19     5        ASSIGN                                                   !2, 'WetPszXfBK3iJgvOh0Wst%2Bj7hBEJbYNGCmR%2BbgZZNglNsHTBh%2FewVS04XpyJUnMTgjvLSoPaCbQ1SIpxJh7eXg%3D%3D'
   20     6        INIT_FCALL                                               'base64_decode'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !3, $9
   22    10        INIT_FCALL_BY_NAME                                       'openssl_private_decrypt'
         11        SEND_VAR_EX                                              !3
         12        SEND_VAR_EX                                              !4
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0          
   24    15        ROPE_INIT                                     3  ~13     'decrypted%3A+'
         16        ROPE_ADD                                      1  ~13     ~13, !4
         17        ROPE_END                                      2  ~12     ~13, '%0A'
         18        ECHO                                                     ~12
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.83 ms | 1451 KiB | 14 Q