b0y-101 Mini Shell


Current Path : E:/www/b-group.old/spfin/paymentall/
File Upload :
Current File : E:/www/b-group.old/spfin/paymentall/test.php

<?php
$data = 'Hello, World!';
$pacoEncryptionPublicKey = file_get_contents('key/PACOEncryptionPublic.txt');
//echo($pacoEncryptionPublicKey);
//$publicKey = openssl_get_publickey($pacoEncryptionPublicKey);
$publicKey = $pacoEncryptionPublicKey;

if ($publicKey) {
    if (openssl_public_encrypt($data, $encryptedData, $publicKey)) {
        echo 'Encrypted data: ' . base64_encode($encryptedData);
    } else {
        echo 'Failed to encrypt data';
    }
    
    // คืนทรัพย์ key resource
    openssl_free_key($publicKey);
} else {
    echo 'Invalid public key';
}
?>

Copyright © 2019 by b0y-101