Cryptographic Science
1.HASH hashing (hash) function
Irreversible (cannot be used for encryption and decryption)
A binary data with only one hash value
2. Asymmetric RSA
Because it is a simple mathematical calculation, so the efficiency of encryption is low, generally used to encrypt the core (small data)
- Public key encryption, private key decryption
- Private key encryption, public key decryption
3. Symmetry
- Des
- 3DES
Aes
Openssl1. Generate the private key:
openssl genrsa -out private.pem 521
View:
cat private.pem
2. The public key is calculated from the private key:
openssl rsa -in private.pem -out public.pem -pubout
View:
cat public.pem
3. For easy viewing, you can output text:
openssl rsa -in private.pem -text -out private.txt
Example: IOS CSR certificate (public key)
Keychain Request CSR certificate, view in Terminal:
cat CertificateSigningRequest.certSigningRequest
Displays a bunch of base64 encoded strings:
- More knowledge of cryptography can be self-Baidu
- Reference articles
- https://www.jianshu.com/p/d9cd97c77549
- https://www.jianshu.com/p/ad29445eb91c
iOS Reverse cryptography