An example of the cryptographic decryption code for NODEJS is as follows:
#!/usr/bin/env node var crypto = require (' crypto '); Decryption function decode (Cryptkey, IV, Secretdata) {var decipher = Crypto.createdecipheriv (' AES-256-CBC ', C Ryptkey, iv), decoded = Decipher.update (Secretdata, ' base64 ', ' UTF8 '); decoded + = decipher.final (' UTF8 '); return decoded; }//Decrypt function encode (Cryptkey, IV, ClearData) {var encipher = Crypto.createcipheriv (' AES-256-CBC ', Cryptkey, iv), encoded = Encipher.update (cleardata, ' utf8 ', ' base64 '); encoded + = encipher.final (' base64 '); return encoded; } var Cryptkey = Crypto.createhash (' sha256 '). Update (' __tazai_wolf__key '). Digest (), iv = ' 1234567890000 BUF = "Hello World", enc = Encode (Cryptkey, IV, BUF); var dec = decode (Cryptkey, IV, ENC); function B64enc (data) {var b = new Buffer (data, ' binary '); Return b.tostring (' base64 '); }console.warn ("Encoded LengTh: ", enc); Console.warn (" Decoded All: "+ dec);
How can PHP write the corresponding encryption and decryption code?
Required to be able to solve the above encryption, such as: gpkr1wgbfhmvnd/hr0eabg==
You can also encrypt the data to decrypt the Nodejs.
Reply content:
An example of the cryptographic decryption code for NODEJS is as follows:
#!/usr/bin/env node var crypto = require (' crypto '); Decryption function decode (Cryptkey, IV, Secretdata) {var decipher = Crypto.createdecipheriv (' AES-256-CBC ', C Ryptkey, iv), decoded = Decipher.update (Secretdata, ' base64 ', ' UTF8 '); decoded + = decipher.final (' UTF8 '); return decoded; }//Decrypt function encode (Cryptkey, IV, ClearData) {var encipher = Crypto.createcipheriv (' AES-256-CBC ', Cryptkey, iv), encoded = Encipher.update (cleardata, ' utf8 ', ' base64 '); encoded + = encipher.final (' base64 '); return encoded; } var Cryptkey = Crypto.createhash (' sha256 '). Update (' __tazai_wolf__key '). Digest (), iv = ' 1234567890000 BUF = "Hello World", enc = Encode (Cryptkey, IV, BUF); var dec = decode (Cryptkey, IV, ENC); function B64enc (data) {var b = new Buffer (data, ' binary '); Return b.tostring (' base64 '); }console.warn ("Encoded LengTh: ", enc); Console.warn (" Decoded All: "+ dec);
How can PHP write the corresponding encryption and decryption code?
Required to be able to solve the above encryption, such as: gpkr1wgbfhmvnd/hr0eabg==
You can also encrypt the data to decrypt the Nodejs.