암호화 및 서명된 메시지를 방금 서명된 PGP 메시지로 변환

암호화 및 서명된 메시지를 방금 서명된 PGP 메시지로 변환

Bob이 Alice로부터 자신의 공개 키로 암호화되고 개인 키로 서명된 메시지를 받았다고 가정해 보겠습니다. 이제 그는 찰리로부터 똑같은 메시지를 받았다는 것을 찰리에게 증명하고 싶어합니다. 이 메시지는 을(를) 통해 생성되었습니다 gpg --sign --encrypt.

내 생각은 그가 메시지를 해독하고 메시지와 서명을 어딘가에 저장할 수 있다는 것입니다. 그러나 이를 달성할 방법을 찾을 수 없습니다. 그러나 GPG가 메시지에 서명한 다음 암호화하므로 이는 적어도 이론적으로는 가능합니다.

이제 그는 어떻게 그렇게 합니까? 아니면 다른 아이디어가 있습니까? Bob은 Charlie에게 메시지가 사실임을 어떻게 증명합니까?

한계:

  • Charlie Bob에게 개인 키를 제공하는 것은 (분명히) 선택 사항이 아닙니다.
  • 커뮤니케이션은 이메일로만 가능합니다.
  • Alice에게 더 이상 연락할 수 없어 메시지가 재전송되거나 Charlie와 Alice가 서로 통신할 수 없습니다. 밥은 자신이 가진 것을 가지고 일해야 했습니다.

답변1

이것은 찾기가 어렵습니다. 로컬이 아닙니다 man gpg.

주문하다:

gpg -vi    --unwrap  msg1.gpg 

( -v장황하고 -i대화형이며 파일을 덮어쓰지 않음을 의미합니다.)

경고: 때로는 출력의 압축을 풀어야 할 수도 있습니다(?).

문서: https://gnupg.org/documentation/manuals/gnupg.pdf

--unwrap This command is similar to ‘--decrypt’ with the difference that the output
is not the usual plaintext but the original message with the encryption layer
removed. Thus the output will be an OpenPGP data structure which often
means a signed OpenPGP message. Note that this option may or may not
remove a compression layer which is often found beneath the encryption layer.

테스트되었습니다(Ubuntu에서, 2023년 8월 업데이트됨).

### Alice(=testS) signed a message and encrypted it
### using Bobs(=test) public key. -r means --recipient

[0] $ echo A message to be signed a sent > message
[0] $ gpg  -u testS  -r test    --sign --encrypt  message 

 ## Alice sent  message.gpg  to Bob

[0] $ gpg -vi    --unwrap  message.gpg    # --output ...
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: public key is 3DF37C69945F312D
gpg: using subkey 3DF37C69945F312D instead of primary key 96B43A891E43F2F4
gpg: using subkey 3DF37C69945F312D instead of primary key 96B43A891E43F2F4
gpg: encrypted with 3072-bit RSA key, ID 3DF37C69945F312D, created 2023-08-29
      "TEST TE <[email protected]>"
gpg: AES256 encrypted data
File 'message' exists. Overwrite? (y/N) n
Enter new filename: message-only-singed.gpg

## Bob sends "unwrapped" (=deciphered) file   message-only-signed.php
## to Charlie
 
[0] $ gpg -d  message-only-singed.gpg      
A message to be signed a sent               <---- The message
gpg: Signature made Tue 29 Aug 2023 22:55:11 CEST
gpg:                using RSA key 6646102A06EC96A49AE8828FCDF0F02D337492DD
gpg:                issuer "[email protected]"
gpg: Good signature from "tests <[email protected]>" [ultimate]   <---- the sig

### Charlie sees that  Alice=testS    signed the message
 

(마지막 명령은 와 함께 사용할 수 있습니다 --output file.)

관련 정보