Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

As sort of a follow up to my (currently) unanswered question, if it is correct, how do i properly calculate and format the packet that actually stores the data being encrypted? I thought I knew what I was doing, but something here causes bouncycastle to freak out.

Using data from the first post and:

AES256 (pgp value 9)

Data (ASCII): 0123456789abcdef

Data + SHA1 Hash (hex): 30313233343536373839616263646566fe5567e8d769550852182cdf69d74bb16dff8e29

random data used in cfb as prefix (hex): 5133c64b4c777b064cfb71e3ddfba19f

Encrypted data (hex): 5e963a759c48fbf2af931c5c575a27821323cd283c244900a60d7bf1147be20e84980021588fcfd85749468e64dfaae2541aabac23d7

packet 2 (tag 18) in hex: = 01 + (Encrypted Data)

According to what i understand, this data will result in the output (both session key packet (tag 1) and encrypted data packet (tag 18)) of:

-----BEGIN PGP MESSAGE-----
Version:

wY4D+UDEMBpnd50QAf92cuXMV6qhSz/aBd7gLs7einXuy4EwYCJMOQ5I84071BAx
ydRlm/qjYkavFFkwpI2LXcVhi0UG+1X2NH1b3f/AAf9F8VuE6Oe5Xf7wtSrOoQrv
TCCz/JuPfG8kh7LkO4v69d3rrt3AVkPDSOt4VVn6fddPdUK0Ss43Rtgp+/H2OSpT
0jcBXpY6dZxI+/KvkxxcV1onghMjzSg8JEkApg178RR74g6EmAAhWI/P2FdJRo5k
36riVBqrrCPX
=I+T/
-----END PGP MESSAGE-----

Can anyone tell me what I did wrong and how to fix it?

Anybody?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.