openssl 명령어
상위 문서: {{ item.title }} -
bash encryption command
cryptography toolkit
$ cat test.txt
hello world!
Examples
help
$ openssl -h # -h 옵션은 없지만 잘못된 옵션이기 때문에 도움말을 볼 수 있다.
$ openssl dgst -h
sha256
$ echo 'hello world!' | openssl sha256
$ openssl dgst -sha256 input.txt
$ cat input.txt | openssl sha256
aes256
encrypt
$ echo 'hello world!' | openssl aes-256-cbc -a
$ echo 'hello world!' | openssl aes-256-cbc -a -salt # with salt
$ openssl aes-256-cbc -a -salt -in input.txt -out output.enc
decrypt
$ openssl aes-256-cbc -d -a -in result.enc
$ echo 'U2FsdGVkX18XbxUsGJ7tvr78efIxek8++Tbovib24Ec=' | openssl aes-256-cbc -a -d # hello world!
base64
encrypt
$ echo 'hello world!' | openssl base64
$ openssl enc -base64 -in input.txt
decrypt
$ echo 'aGVsbG8gd29ybGQhCg==' | openssl base64 -d # hello world!
소수 관련 기능
$ openssl prime # 도움말
$ openssl prime 997 # 997 이 소수인지 조사한다
$ openssl prime -hex ff0 # ff0 이 소수인지 조사한다
$ openssl prime -generate -bits 16 # 랜덤으로 16 비트 소수 생성