gumara

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

decrypt msg ด้วย gpg

Submitted by gumara on Sat, 08/09/2008 - 07: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.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Twitter-style @usersnames are linked to their Twitter account pages.
  • Twitter-style #hashtags are linked to search.twitter.com.

More information about formatting options

rMilk

Comment

Tags

Another ~


Let's chat

User login

del.icio.us/~

tweet me

Add to Technorati Favorites


Stat:

free web tracker