#GPUPG: #보안키 #암호키
#GPUPG: #보안키 #암호키
2024-06-10 Note gnupg notes toolsDONE 2022년 작업 내용 기록
gpg 생성하는 것은 좋은데, 이맥스에 authinfo 를 만들어야 해서 말이야.
gpg 생성
➜ ~ gpg --gen-key gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Note: Use "gpg --full-generate-key" for a full featured key generation dialog. GnuPG needs to construct a user ID to identify your key. Real name: Junghan Kim Email address: junghan0611@proton.me You selected this USER-ID: "Junghan Kim <junghan0611@proton.me>" Change (N)ame, (E)mail, or (O)kay/(Q)uit? o We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. gpg: key 83301E1E14D1573B marked as ultimately trusted gpg: directory '/home/junghan/.gnupg/openpgp-revocs.d' created gpg: revocation certificate stored as '/home/junghan/.gnupg/openpgp-revocs.d/A357919A44C2BA499512ED6B83301E1E14D1573B.rev' public and secret key created and signed. pub rsa3072 2022-08-02 [SC] [expires: 2024-08-01] A357919A44C2BA499512ED6B83301E1E14D1573B uid Junghan Kim <junghan0611@proton.me> sub rsa3072 2022-08-02 [E] [expires: 2024-08-01]
gpg 의미
pub rsa3072 2022-08-02 [SC] [expires: 2024-08-01] A357919A44C2BA499512ED6B83301E1E14D1573B uid Junghan Kim junghan0611@proton.me sub rsa3072 2022-08-02 [E] [expires: 2024-08-01]
➜ ~ gpg -k /home/junghan/.gnupg/pubring.kbx -------------------------------- pub rsa3072 2022-08-02 [SC] [expires: 2024-08-01] A357919A44C2BA499512ED6B83301E1E14D1573B uid [ultimate] Junghan Kim <junghan0611@proton.me> sub rsa3072 2022-08-02 [E] [expires: 2024-08-01] ➜ ~ gpg --list-secret-keys /home/junghan/.gnupg/pubring.kbx -------------------------------- sec rsa3072 2022-08-02 [SC] [expires: 2024-08-01] A357919A44C2BA499512ED6B83301E1E14D1573B uid [ultimate] Junghan Kim <junghan0611@proton.me> ssb rsa3072 2022-08-02 [E] [expires: 2024-08-01]
공개 키 export “내가 준 공개 키 있지? 그걸로 암호화해서 보내줘. 그러면 내 비밀키로 볼 수 있거든. 비밀키는 나한테만 있으니까 나만 볼수 있어. 걱정마!” 내 공개키는 다음과 같아!
➜ ~ gpg --armor --export "Junghan Kim" -----BEGIN PGP PUBLIC KEY BLOCK----- mQGNBGLpHz8BDACpdHuxkBHdvgpDxlQHtofpeV0nk+lLf5r5+K9k5mwYsqFtDwrt WhhsehyCnabqu0bHS8rpTy0GgxCa06r6KJ6ZRqY4ftVG8BujGf1t3VvzWE/CYiIJ uOlZ1oYmecw5OkpabAfENo4LPPhQ09I347AXNspEtt5vw2Edc4a0yasZE8maVylA PLERQNpCAeRc7Jm5n6pPTEtjcj25WAmE506y6Y/wP6BnT/z2TX2cLacDEv5Mwqua uYwgcjBxi9ztkKyYb80X1kfOVE2STE/t3wprjH1Jamg4PxUB+hFT9x9WHAWaZyvZ NF8IGWiZZAlXwwZsuIJMo+XYgjpfONj6JqU1EVGu4RbdivgT35zTX0Ugz8RBMAJW alaZW2+sILZQV/R223juggAkxO4JLgNBudD5lJNcAE+Z4v7kZ4z3eKlEZcAwfUsu rm4PN7+DYR14QVE1/yT0mZIBX21tnxBA8fB6It14pYvTfz7VS/O09QrkKdpp/u4v gJhLm+2Uis+uFXEAEQEAAbQjSnVuZ2hhbiBLaW0gPGp1bmdoYW4wNjExQHByb3Rv bi5tZT6JAdQEEwEKAD4WIQSjV5GaRMK6SZUS7WuDMB4eFNFXOwUCYukfPwIbAwUJ A8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCDMB4eFNFXO+8xDACWBK9a Hd0Pmh4WelL+8wPcX6TxffO20Gqa/h2YsRD2ixB94CkEAqLCIWUM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gv7BhggfuW/BdGYAlJJK/5+vTp9VOxo d4fjQ8ZAPUyk6hX7Jir98i1QLH4zH5waRgF3HaXuVDc33f5SmYXeJMNSl7DTj+xs CMs0muQm/h+6HOKh9MkVhfPAYo/kJUzXSNHmIWjVZViNBqUl2SmPWJEP7WPGtdtI gp4sjThMn0nQvrdZSCAmcS389/8LgEAxoSH109cI0GwQTe3AiNdljNGQwV1Yxy9r vFFsezIKZotEXmmvlDLR4ggblG/BFhHXD8lq7LAE+dfFPhMv0mR83+VoEz8EU6Rr PCgZamhu37jZLJagfAgDpUrpljROZOB0uNXfXpRsOPmkN2/w2ZTaTidWWghfqV/q arUV1G/tf2TDoYrWRz55O8Qe2kmm7oGkYK1ZF8MkdVmftWpTxN5dWH0qoT0G24G3 kMm8gmb5qNnGWRSRKZN6XQaf2HLs9pTHCpPZPGkd38npZ0bgOy+A1MTWedTj82kO GNQJtKiECurjMPgn89tjY0VDRLcP6Y8f/3RK =3729 -----END PGP PUBLIC KEY BLOCK-----
키 서버로 전송하자
- hkp://keyserver.ubuntu.com 를 사용했다.
➜ ~ gpg --keyserver hkp://keyserver.ubuntu.com --send-key A357919A44C2BA499512ED6B83301E1E14D1573B gpg: sending key 83301E1E14D1573B to hkp://keyserver.ubuntu.com ➜ ~
비밀키 export
- ➜ ~ gpg –armor –export-secret-key “Junghan Kim” > junghan0611.proton.me.asc
공개키 import
- gpg –import abc.asc
비밀키 import
- gpg –import 비밀키파일
비밀키 비밀번호 변경
- gpg –edit-key 비밀키아이디
Related-Notes
- 기계인간님 블로그 글 https://johngrib.github.io/wiki/gpg/
References
마지막 수정일자