OpenSSL์„ ์ด์šฉํ•œ ๋Œ€์นญํ‚ค ์•”ํ˜ธํ™”
Security

OpenSSL์„ ์ด์šฉํ•œ ๋Œ€์นญํ‚ค ์•”ํ˜ธํ™”

1. ๋Œ€์นญํ‚ค ์ƒ์„ฑ

- DES ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์‚ฌ์šฉ

openssl genrsa -des3 -out privatekey.pem

 

2. ์•”ํ˜ธํ™”

- ๋น„๊ณต๊ฐœํ‚ค ์‚ฌ์šฉ

openssl rsautl -encrypt -inkey privatekey.pem -in plaintext.txt -out ciphertext.txt

์•”ํ˜ธ๋ฌธ ํ™•์ธ ๊ฐ€๋Šฅ

 

3. ๋ณตํ˜ธํ™”

- ๋น„๊ณต๊ฐœํ‚ค ์‚ฌ์šฉ

openssl rsautl -decrypt -inkey privatekey.pem -in ciphertext.txt -out plaintext_out.txt

ํ‰๋ฌธ ํ™•์ธ ๊ฐ€๋Šฅ