Home> PHP Framework> Swoole> body text

Can swoole encryption be cracked?

Release: 2019-12-17 10:03:12
Original
10197 people have browsed it

Can swoole encryption be cracked?

The execution of the program and the encryption and decryption process are unified. No matter it is attacked by internal developers or external hackers, even if they get the data and private keys and the root permissions of the server, they can still Unable to decrypt restore data.

Swoole divides encryption and decryption into 3 parts (program, algorithm, private key), one of which is indispensable for decryption.Only the PHP program compiled and generated by the corresponding Swoole Compiler can decrypt the data.

Swoole Compiler data encryption uses asymmetric encryption and requires the generation of public and private keys. Swoole Compiler provides two functions to implement encryption and decryption. These two functions must be used in encrypted programs and cannot be used in unencrypted PHP programs.

The data encryption module requires additional payment, the price is 30% of the Compiler

Generate public and private keys

swoole-compiler gen-keypair
Copy after login

After successful execution , two files, public_key and private_key, will be generated in the current directory.

public_key public key, used for encryption

private_key private key, used for decryption

Data encryption

$encryptedData = swoole_encrypt($oriData, "./public_key");
Copy after login

Data decryption

$oriData = swoole_decrypt($encryptedData, "./private_key");
Copy after login

Applicable scenarios

Swoole Compiler data encryption is very suitable for background programs that are sensitive to data security, such as storing user bank cards and ID cards. number and other user privacy information. Use Swoole Compiler to encrypt data and store it in the database.

Recommended learning:swoole video tutorial

The above is the detailed content of Can swoole encryption be cracked?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!