2014. 5. 27. 21:19

OpenSSL을 이용한 암호화 / 복호화 방법

1.  Encryption(암호화 방법)

$openssl des3 -salt -in 원본파일명 -out 암호화된파일명

ex)

$ head -10 loveisyou.txt

What's your definition of it?

Hows it make you feel?

Tell me what you say that truly makes it real

Kings and Queens, Philosophers have tried so hard to find

Tell me what it means to you dear, nevermind



Love is kind when the world is cold

Love stays strong when the fight gets old

Love's a shoulder to lean on



$ openssl des3 -salt -in loveisyou.txt -out loveisyou.txt.enc

enter des-ede3-cbc encryption password:

Verifying - enter des-ede3-cbc encryption password:


$ head -10 loveisyou.txt.enc

i▒▒%a▒\^▒8▒z.▒▒k▒w▒▒▒gQ~ ▒"▒▒sPr▒r▒w▒-▒my▒:YvxQʝa▒

         ▒$DK▒▒M}z▒▒H{▒s▒▒9Z▒▒▒yB &▒▒M#Tu▒I?=▒-m▒d▒߸=▒q▒▒u7A▒bӘ▒▒▒▒Ba▒NC▒f~▒\uX▒>T4;#▒`_믃'@4▒j%q5▒/540▒▒f▒▒▒M▒ >͹ךyUNSIm▒▒)▒▒xKB!*(A▒`\R▒Lr▒▒g%J;▒▒q▒▒▒*e*▒@▒(▒MR▒▒<֜|l;cJd▒y▒▒▒oM▒▒}▒▒.▒$▒▒?p▒▒▒aK&Bi▒         )Xk▒`▒4▒:U▒▒▒▒_▒Eh▒cl▒J▒3mXT▒▒wII▒▒K▒op^:F)Q~%▒Tv▒▒3+!▒ЀH▒4,>a찚!j#t▒ɩ▒

0▒;P▒▒v▒▒4A⟥(?▒▒f▒5/\_i'▒▒▒(b▒Yxo>▒p▒k(\▒zS͔▒▒9zfr}`2"▒▒


                                                       ▒▒8▒▒▒

                                                             ▒`粉▒▒63▒۔▒:





2. 복호화 방법

$openssl des3 -d -salt -in 암호화된파일명 -out 복호화된출력파일명


$ head -10 loveisyou.txt.enc

i▒▒%a▒\^▒8▒z.▒▒k▒w▒▒▒gQ~ ▒"▒▒sPr▒r▒w▒-▒my▒:YvxQʝa▒

         ▒$DK▒▒M}z▒▒H{▒s▒▒9Z▒▒▒yB &▒▒M#Tu▒I?=▒-m▒d▒߸=▒q▒▒u7A▒bӘ▒▒▒▒Ba▒NC▒f~▒\uX▒>T4;#▒`_믃'@4▒j%q5▒/540▒▒f▒▒▒M▒ >͹ךyUNSIm▒▒)▒▒xKB!*(A▒`\R▒Lr▒▒g%J;▒▒q▒▒▒*e*▒@▒(▒MR▒▒<֜|l;cJd▒y▒▒▒oM▒▒}▒▒.▒$▒▒?p▒▒▒aK&Bi▒         )Xk▒`▒4▒:U▒▒▒▒_▒Eh▒cl▒J▒3mXT▒▒wII▒▒K▒op^:F)Q~%▒Tv▒▒3+!▒ЀH▒4,>a찚!j#t▒ɩ▒

0▒;P▒▒v▒▒4A⟥(?▒▒f▒5/\_i'▒▒▒(b▒Yxo>▒p▒k(\▒zS͔▒▒9zfr}`2"▒▒


                                                       ▒▒8▒▒▒

                                                             ▒`粉▒▒63▒۔▒:



$ openssl des3 -d -salt -in loveisyou.txt.enc -out loveisyou.txt.out
enter des-ede3-cbc decryption password:
$ head -10 loveisyou.txt.out
What's your definition of it?
Hows it make you feel?
Tell me what you say that truly makes it real
Kings and Queens, Philosophers have tried so hard to find
Tell me what it means to you dear, nevermind


Love is kind when the world is cold
Love stays strong when the fight gets old
Love's a shoulder to lean on



Posted by Triany