gumara

เหนือกว่าเหตุผล ผมไม่มีเหตุผล

decrypt msg ด้วย gpg

Submitted by gumara on Sat, 09/08/2008 - 14:56

พอดีว่าไม่มีเหตุให้ต้อง decrypt msg บ่อยนัก เลยจำวิธี ไม่ค่อยได้ วันนี้ได้น้องวินทำให้ดูอีกรอบ จดไว้กันลืม

gumara@dapper:~$ cat << EOF > msg

แล้วก๊อบ msg มาใส่

gumara@dapper:~$ cat << EOF > msg
> -----BEGIN PGP MESSAGE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> hQEOA4WBoTaYhc3VEAP8DabHHyw0PilLgf9o2hjO0+LPdltEPTxIp8Bu89cSH5CT
> OOrOPTGCAozDvW1VfdbAqDgrbu4IZ0n6D38Y8N4qHuJujdnD9dUozntopAuj0AS3
> InBZ9CN+jymL1EUYhVGaIz6/lpH0cVF6r4gJTDhe0sIsPbDwt6hD0nSIJ7PLqm6N
> +9F7/W1KFfBb0yOKoVzDMGGd4vSZnv+mFw==
> =XDSQ
> -----END PGP MESSAGE-----

พิมพ์ว่า EOF ตบท้ายลงไป Enter

gumara@dapper:~$ cat << EOF > msg
> -----BEGIN PGP MESSAGE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> hQEOA4WBoTaYhc3VEAP8DabHHyw0PilLgf9o2hjO0+LPdltEPTxIp8Bu89cSH5CT
> OOrOPTGCAozDvW1VfdbAqDgrbu4IZ0n6D38Y8N4qHuJujdnD9dUozntopAuj0AS3
> InBZ9CN+jymL1EUYhVGaIz6/lpH0cVF6r4gJTDhe0sIsPbDwt6hD0nSIJ7PLqm6N
> +9F7/W1KFfBb0yOKoVzDMGGd4vSZnv+mFw==
> =XDSQ
> -----END PGP MESSAGE-----
> EOF

สั่ง decrypt msg

gumara@dapper:~$ gpg --decrypt msg

คิดว่าไม่มีไรตกหล่นนะ

เทคนิคนี้ เอามาจาก LFS ครับ

เทคนิคนี้ เอามาจาก LFS ครับ ได้ใช้บ่อย
ทีนี้ ถ้างงกับ << EOF ใช้ nano -L ก็ได้ครับ(-L คือไม่เติม trailing newline ตามมาตราฐาน unix ครับ)

Post new comment

The content of this field is kept private and will not be shown publicly.
Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.


Let's chat

Comment

Tags

tweets

del.icio.us/~

Another ~

The Ubuntu Counter Project - user number # 5754
Add to Technorati Favorites