Answer the question
In order to leave comments, you need to log in
Encryption in Javascript ("Cryptico") and decryption in PHP how to implement?
Good afternoon everyone, I use Javascript ("Cryptico") for data encryption on the client side based on RSA AES and BCB
Private and public key, how to encrypt data and decrypt data encrypted on the client side using PHP ?
var PassPhrase = "The Moon is a Harsh Mistress." // Пароль
var Bits = 1024; // битность ключа
var MattsRSAkey = cryptico.generateRSAKey(PassPhrase, Bits); // создание ключа
var PlainText = "Matt, I need you to help me with my Starcraft strategy"; //текст который нужно зашифровать
var MattsPublicKeyString = cryptico.publicKeyString(MattsRSAkey); //получение публичного ключа
var EncryptionResult = cryptico.encrypt(PlainText, MattsPublicKeyString); // Результат шифрования
var CipherText = EncryptionResult.cipher; //Шифрованные текст
var DecryptionResult = cryptico.decrypt(CipherText, MattsRSAkey); //результат дешефровки
Answer the question
In order to leave comments, you need to log in
php.net/manual/en/function.openssl-public-decrypt.php
if (openssl_public_decrypt(base64_decode($_POST["CipherText"]), $data, base64_decode($_POST["MattsRSAkey"]))) echo $data;
else echo 'Ошибка!';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question