显示下拉菜单

Test of openssl_private_decrypt() 本页面仅提供英文版本。

Example #1 : test success
Example #2 : test success
Example #3 : test not validated (platform dependant or random result etc.)
Example #4 : test not validated (platform dependant or random result etc.)
Example #1
$input = [
  
=> '_DOUBLE_QUOTES_\\xb8\\x9a\\x8c\\x26\\x19\\x0a\\x24\\xc1\\xf3\\x7a\\x9d\\x74\\xe3\\x28\\xff\\xf7\\x99\\x98\\x1d\\xd1\\xef\\xbc\\x8e\\x35\\x56\\xd5\\x41\\xe4\\x07\\xf6\\xa9\\xb7\\xc5\\x67\\xbe\\x9c\\xc1\\x91\\x61\\xbe\\x66\\x19\\x11\\x6d\\x41\\xba\\x12\\xde\\x02\\x81\\x13\\x54\\x37\\xee\\x6b\\x4c\\x2a\\xe1\\x6e\\x81\\x02\\x35\\x41\\xdc\\xea\\x81\\x7f\\xcb\\xe4\\x48\\xe8\\x59\\x6f\\x67\\xd4\\x98\\xc0\\x47\\x6f\\x6c\\x3c\\x13\\xf8\\x59\\x49\\x73\\x46\\x79\\xd2\\x45\\x5f\\x13\\x36\\x59\\x1b\\x97\\xfd\\xb4\\x16\\xa3\\xa4\\x31\\xee\\x0f\\x2c\\xbb\\x30\\x95\\x07\\xa1\\xfe\\x8e\\xe8\\x1d\\xd2\\xd7\\xce\\x22\\x7f\\xbe\\x9d\\xd9\\x6c\\x42\\x55\\x94\\xf8\\x51\\x14\\x1d\\xf7\\xf5\\x29\\x27\\xe6\\x85\\xae\\x46\\xe9\\xfa\\x93\\xf8\\xf0\\x04\\xd0\\x6c\\x9b\\x5f\\x1c\\x82\\x8a\\xa7\\x7a\\xc3\\xa9\\x16\\x51\\xd0\\xf4\\x70\\x17\\xd6\\x56\\xec\\x3b\\xf6\\xff\\x28\\xf0\\x3a\\x17\\xe4\\xb6\\xc7\\xa0\\xa8\\x75\\x0d\\x71\\x2d\\x30\\xfd\\xdd\\x5b\\xfd\\xd7\\x49\\x2c\\xa0\\x50\\x95\\x02\\xce\\x68\\xec\\x09\\xc7\\xd6\\x40\\x9b\\xb2\\x42\\xa0\\xe4\\xdd\\x60\\x10\\x65\\x60\\xba\\xe1\\x56\\xae\\xed\\xe1\\xa8\\xf2\\x46\\x5a\\x54\\x9b\\x0e\\xfa\\xb4\\xe9\\x6f\\xaa\\x8e\\xce\\xff\\x88\\xca\\x33\\xd6\\x4c\\x39\\xfb\\x8e\\xfc\\x33\\x44\\x0b\\x79\\x98\\x8f\\x19\\x4a\\x34\\x80\\xd5\\x11\\x4a\\x78\\x92\\x18\\x8b_DOUBLE_QUOTES_',
  
=> '$decrypted',
  
=> 'file:///tmp/private-key.pem',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'decrypted' => 'this is some data',
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
'base64' => 'uJqMJhkKJMHzep104yj/95mYHdHvvI41VtVB5Af2qbfFZ76cwZFhvmYZEW1BuhLeAoETVDfua0wq4W6BAjVB3OqBf8vkSOhZb2fUmMBHb2w8E/hZSXNGedJFXxM2WRuX/bQWo6Qx7g8suzCVB6H+jugd0tfOIn++ndlsQlWU+FEUHff1KSfmha5G6fqT+PAE0GybXxyCiqd6w6kWUdD0cBfWVuw79v8o8DoX5LbHoKh1DXEtMP3dW/3XSSygUJUCzmjsCcfWQJuyQqDk3WAQZWC64Vau7eGo8kZaVJsO+rTpb6qOzv+IyjPWTDn7jvwzRAt5mI8ZSjSA1RFKeJIYiw==',
  
=> '$data',
  
=> '$decrypted',
  
=> 'file:///tmp/private-key.pem',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'data' => '&
$zt(.5VAgafmAT7kL*n5AHYogԘGol<YIsFyE_6Y1,0"lBUQ)\'慮Fl_zéQpV;(:Ǡu q-0[I,Ph    @B`e`VFZTo3L93D yJ4Jx'
,
    
'decrypted' => 'this is some data',
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
'e_data' => 'this is some data',
  
'e_key' => 'file:///tmp/public-key.pem',
  
'base64' => '$base64',
  
=> '$data',
  
=> '$decrypted',
  
=> 'file:///tmp/private-key.pem',
]
test not validated (platform dependant or random result etc.)
$test_output = [
  
'result' => [
    
'e_bool' => true,
    
'data' => '^%ȕ Zav(B@,<^8+Of' "\0" '6`TZik=E:0vް_NY<,KL|T_Y wǻKgtLec[HWz|ضKIֱNx+\\[KV("> ^&O9a
Ju[E%ioPqS4!}J?qXJ$4a|kf@'
,
    
'base64' => 'HpQTXhEljt8Xte/IlQxaHmGGdq4oEJv37sjcQn9A3yw8yl449RqGK7LFT2YAlfDikNLmljasGWDJVJcIEVrK7anVHq29HJzAiRJpawM95UWPOpETt4ow9gV2Bt6w1F/PTln26DyXLA61nAeap0tMfMD/VF9ZC/Z3f8e7Dh6YkktnywXE+abOz/vjAxfrdPdMZblj7hEC5VtIV47genzYthBLSemYHtrEH9axTt14K6enXFtL11YoqyI+tKvtsAte2yZPOWEK19z5SnVbB0UlaZuHb8X2UHFTNPch5H0USj+Ar/ur99vfccvEWLerSrAkNBu0mmHa77R8z2uDnmZAkw==',
    
'decrypted' => 'this is some data',
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #4
$input = [
  
'e_data' => 'this is some data',
  
'e_key' => '-----BEGIN PUBLIC KEY-----
                MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0llCeBjy18RylTdBih9G
                MUSZIC3GzeN0vQ9W8E3nwy2jdeUnH3GBXWpMo3F43V68zM2Qz5epRNmlLSkY/PJU
                fJIC8Yc1VEokT52q87hH/XJ5eS8heZnjuSlPAGi8oZ3ImVbruzV7XmlD+QsCSxJW
                7tBv0dqJ71e1gAAisCXK2m7iyf/ul6rT0Zz0ptYH4IZfwc/hQ9JcMg69uM+3bb4o
                BFsixMmEQwxKZsXk3YmO/YRjRbay+6+79bSV/frW+lWhknyGSIJp2CJArYcOdbK1
                bXx1dRWpbNSExo7dWwuPC0Y7a5AEeoZofieQPPBhXlp1hPgLYGat71pDqBjKLvF5
                GwIDAQAB
                -----END PUBLIC KEY-----'
,
  
=> '$data',
  
=> '$decrypted',
  
=> '-----BEGIN RSA PRIVATE KEY-----
            MIIEogIBAAKCAQEA0llCeBjy18RylTdBih9GMUSZIC3GzeN0vQ9W8E3nwy2jdeUn
            H3GBXWpMo3F43V68zM2Qz5epRNmlLSkY/PJUfJIC8Yc1VEokT52q87hH/XJ5eS8h
            eZnjuSlPAGi8oZ3ImVbruzV7XmlD+QsCSxJW7tBv0dqJ71e1gAAisCXK2m7iyf/u
            l6rT0Zz0ptYH4IZfwc/hQ9JcMg69uM+3bb4oBFsixMmEQwxKZsXk3YmO/YRjRbay
            +6+79bSV/frW+lWhknyGSIJp2CJArYcOdbK1bXx1dRWpbNSExo7dWwuPC0Y7a5AE
            eoZofieQPPBhXlp1hPgLYGat71pDqBjKLvF5GwIDAQABAoIBACPItYsSy3UzYT7L
            OKYTrfBBuD8GKpTqBfkHvAWDa1MD15P92Mr7l0NaCxGfAy29qSa6LdFy/oPM9tGY
            9TxKyV6rxD5sfwEI3+Z/bw6pIe4W5F1eTDaQnHHqehsatkRUQET9yXp+na8w/zRF
            0C0PQKS95tfvcpm59RGCdGQ8+aZw+cIy/xez75W8IS/hagMxe7xYPjpkOkSCCEJU
            zmbVq6AyWodASV0p4H9p8I+c0vO2hJ/ELJ167w6T+2/GlZg979rlyHoTW8jK2BbG
            IRGaPo+c2GANXa686tdpbkPd6oJliXwBSNolxmXShvlveBbPFAJJACzCmbXNj9kH
            6/K+SWkCgYEA7FNudcTkRPV8TzKhJ1AzDjw3VcnraYhY8IlNxbk7RVHLdkoUtwk/
            mImeBlEfCoz9V+S/gRgeQ+1Vb/BCbS24+bN/+IGoNRFMRcOieFt6lQUpj7a9NeSo
            IEclGgUiU7QR3xH73SB4GC3rgSPeHJhJZC5EJq5TzYjXTPGPpBD3zicCgYEA49wz
            zfMDYIH8h4L65r/eJYIbLwpvgktgaYvhijO3qfZSWW+Y19jCBn55f65YOhPGQBHA
            my0f+tVxFNZ/OupbrAIIzogxlCIYHNBawDhoHN/sB3/lSBAjifySNLyRlA62oA0w
            wXvXVLVWMa3aXim3c9AlnLF1fHwcvwpOKSfdye0CgYBb1mBKq+T5V1yjek1d9bCh
            i40FbZ5qOG43q2Ppvn3mBk9G/KroJlPsdy5NziB9/SRGj8JL7I92Xjihc4Cc5PPJ
            NZQ5gklXtg0p30i39PTCDGuGScFlvCIJyRwF7JDWblezlE2INSH2Y4HtgX7DJfr/
            T2t0jLJMYS0p3YWwgFeMaQKBgHUIe/8y6zAdc5QynSX5tGL1gXrW1FFK39k2RICU
            cag1YTSYkhuDNJzbRxJifORPlcsAkzngooVWLb+zMCQVjUI6xUU3RKe+Hz5lccc6
            8ZarGHL9qMkrqOVNudamZ+tw5zIrtDgcoIvcm8nmbrtgl94/MaJar2ph4O3qoByZ
            Ylw9AoGAIdS79s0VKkj4VVXqK47ZcI7jGL4V4C8ujU8YcMNV88xwCoDg9ZIFprWA
            P5p/cnvj6aHnqL58XiH0+bE0Lt3J+U6N6JelQQevgBHooMFh4FpDXcVda7xB3rK3
            woqbi8fNhr827H2maxIZPtVG95/mvR4k5z1Jrdnr34ZUmtC6U5Q=
            -----END RSA PRIVATE KEY-----'
,
]
test not validated (platform dependant or random result etc.)
$test_output = [
  
'result' => [
    
'e_bool' => true,
    
'data' => '8]bbad]I Tk' "\0" ',.$L]wSm4eQv5}Ps h7N}eH     =g^ə0]܅va^rT9dk46Qi:X =*Y3KRKՓ7`.s~\\$4ro\'=7\'b_g#*?qq.oG%7S"5&>W@iMy&    -',
    
'base64' => 'gjjSXWIQYmFkXUkaBQ3179ZUawDyoywu/6IkTLFdE4x3FpVTyG30NGVRrKoej3bj1ho1fe1Qr48YnPmJcyCAv2jjzcY3+5ugu059ZUgJID1nErX4XvrJmTCehOVdhIfchXYWyQTBYdBeclQZ1zlkmGvbNBo2UdnHaZs6tdtY0fAMgJCCH8PtmuU9KlkzpEtS3ksZ1ZP3N9hgD7O/qRsujnMCGv2w4H5c7iQ0p5ZyHptv9KeNlSc9Nye6z2KZ5Ba04RqYX9jDZ5OYIyo/cZtxyy6XCBypuG+IzREcR5i+8aX0JTflU4IiNZjCJj71lVeCzfJAaU3VHnnTGCYJLYaM3w==',
    
'decrypted' => 'this is some data',
    
'bool' => true,
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]