[Encrypt] 公開金鑰加密 – Public-key cryptography

Intro

Public-key cryptography


私鑰產生公鑰

SSH-Key

ssh-keygen -y -f id_rsa > id_rsa.pub

PEM格式

openssl rsa -in private-key.pem -pubout -out public-key.pem

公私鑰加解密

公私鑰皆可以非對稱的加解密,例如PHP functions:
openssl_private_decrypt
openssl_private_encrypt
openssl_public_decrypt
openssl_public_encrypt

Leave a Reply

Your email address will not be published. Required fields are marked *