Closed djtimo18 closed 3 years ago
Hi there,
$username = $_GET['username']; $sth = $conn->prepare("SELECT * FROM user WHERE username=:username"); $sth->bindParam(':username', $username); $sth->execute(); $row = $sth->fetch(PDO::FETCH_ASSOC); $pgp_key = $row['pgp_key']; $real_code = $row['2fa_code'];
user
$key = OpenPGP_Message::parse($pgp_key); $data = new OpenPGP_LiteralDataPacket($real_code); $encrypted = OpenPGP_Crypt_Symmetric::encrypt($key, new OpenPGP_Message(array($data)));
I need to make an "echo $encrypted_message" how i can do it please ?
Please try $encrypted_message = $encrypted->to_bytes();
$encrypted_message = $encrypted->to_bytes();
Hi there,
$username = $_GET['username']; $sth = $conn->prepare("SELECT * FROM
user
WHERE username=:username"); $sth->bindParam(':username', $username); $sth->execute(); $row = $sth->fetch(PDO::FETCH_ASSOC); $pgp_key = $row['pgp_key']; $real_code = $row['2fa_code'];$key = OpenPGP_Message::parse($pgp_key); $data = new OpenPGP_LiteralDataPacket($real_code); $encrypted = OpenPGP_Crypt_Symmetric::encrypt($key, new OpenPGP_Message(array($data)));
I need to make an "echo $encrypted_message" how i can do it please ?