Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test vectors v6 sign+encrypt for crypto-refresh #18

Closed
falko-strenzke opened this issue Mar 29, 2023 · 5 comments
Closed

Test vectors v6 sign+encrypt for crypto-refresh #18

falko-strenzke opened this issue Mar 29, 2023 · 5 comments
Assignees
Labels
test Pertaining to unit tests etc

Comments

@falko-strenzke
Copy link
Contributor

falko-strenzke commented Mar 29, 2023

Test vector from us for signed and encrypted message should be created with existing sample key .../rfc4880bis/crypto-refresh.html#section-a.4

  • Test vector with v6 PKESK
  • Test vector with v3 PKESK
@TJ-91
Copy link
Collaborator

TJ-91 commented Mar 29, 2023

UPDATE: this is only encrypted, not signed. I will make new test vectors.

Test PKESKv3+SEIPDv11 and PKESKv6+SEIPDv2 data for public key https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-08#v6-key:

PKESKv6

-----BEGIN PGP MESSAGE-----

wWwGBhLIPx5wb2MI/hUaQXdDofAzeQ6T6ZeEiNHbN42pkwiFGdPoftROCLuTU7ar/qoDqH0AqVGr
UxVkPnG+ChkHUftHKB8vsmvimAkodyYpnWtWIYmwJ8LItmXC1vXp4dwk9QerzZpxlypatUQ=
=Zh51
-----END PGP MESSAGE-----

SEIPDv2

-----BEGIN PGP MESSAGE-----

0mQCCQIM9vVo2gnlXvZ+NzRwQr4asrxwe5dJvUoX6Z1x3yarqnE/Fz+DlHoAK/vSXdPcEf9PNB56
JG4rksDiNWApRuS+SgcLNbsMJ+ntKSCr6TE3IThMs6SGNnaD1MjOzmwGwfhy
=MAZM
-----END PGP MESSAGE-----

Both together

-----BEGIN PGP MESSAGE-----

wWwGBhLIPx5wb2MI/hUaQXdDofAzeQ6T6ZeEiNHbN42pkwiFGdPoftROCLuTU7ar/qoDqH0AqVGr
UxVkPnG+ChkHUftHKB8vsmvimAkodyYpnWtWIYmwJ8LItmXC1vXp4dwk9QerzZpxlypatUTSZAIJ
Agz29WjaCeVe9n43NHBCvhqyvHB7l0m9ShfpnXHfJquqcT8XP4OUegAr+9Jd09wR/080HnokbiuS
wOI1YClG5L5KBws1uwwn6e0pIKvpMTchOEyzpIY2doPUyM7ObAbB+HI=
=5NU9
-----END PGP MESSAGE-----


PKESKv3

-----BEGIN PGP MESSAGE-----

wVQD0ds3jamTCIUZCTkTr+SDzuCW4CwF9a5UoCYwqlTYwpGs4PBSkReb+2UTKL+fdywl2kwGHFj1
3U0zoUTKsJvO2OZftGUWh7F5MRg/bVHgqIKesac=
=BKpx
-----END PGP MESSAGE-----

SEIPDv1

-----BEGIN PGP MESSAGE-----

0kkBPu5rI5BWXpXa8XkCZNhC+Vt7VGA6KXXcra6Yd/dmkgVXIOULQfq8P0NF4h1KoD5+sEFXSPVd
jAirVvXg55S0jwbV5gUhC15r
=wzb1
-----END PGP MESSAGE-----

Both together

-----BEGIN PGP MESSAGE-----

wVQD0ds3jamTCIUZCTkTr+SDzuCW4CwF9a5UoCYwqlTYwpGs4PBSkReb+2UTKL+fdywl2kwGHFj1
3U0zoUTKsJvO2OZftGUWh7F5MRg/bVHgqIKesafSSQE+7msjkFZeldrxeQJk2EL5W3tUYDopddyt
rph392aSBVcg5QtB+rw/Q0XiHUqgPn6wQVdI9V2MCKtW9eDnlLSPBtXmBSELXms=
=1gfv
-----END PGP MESSAGE-----

Commands to generate with RNP

  • assumes clean ~/.rnp/ directory (rm -rf ~/.rnp/)
cd build/
echo "cleartext"  > cleartext_to_enc
./src/rnpkeys/rnpkeys --import-keys ../src/tests/data/test_v6_valid_data/transferable_seckey_v6.asc
./src/rnp/rnp -e --armor --v3-pkesk-only --output encrypted.pgp cleartext_to_enc
./src/rnp/rnp --list-packets encrypted.pgp --raw
./src/rnp/rnp -d --output decrypted encrypted.pgp
cat decryped

for v6 PKESK don't add --v3-pkesk-only

@TJ-91
Copy link
Collaborator

TJ-91 commented Mar 30, 2023

Encypted + Signed v3 PKESK + v1 SEIPD

-----BEGIN PGP MESSAGE-----

wVQD0ds3jamTCIUZCdYaNvSU+wDFcvB0TZz5SkVcWqagNqhLUIZLkIvu/6gEKPXjSj5ztzMMJhX7
v7ISMbk2vqNJuqLj+LaWyjICW1P9JgIDE7U7eoLSwCIBX3MH4fxVH0ZRKY0hVFW/agnTphtZ4szr
WdTFEnnL/Ac+NzhfK/h2FQ8CUujvgjimkAKyRFySQoUwUn6UYbuQs+nkunBYhQzBct7gsnDX6j6L
8HhHMpZgZrXFGREV8CyobvYBYL46QLPYWj3mfDHQHLc9Q+B6vLkarEFKDJrNnWK60A3eeD5Cp1P7
PCsWVNxGtOnKC6vs5gMqMQG0AHKvZ9jIPlNkd3k/xUbjxKOz9yV/Axj9KCQb0uZnLKxXpGYQgZHN
t7roLzA3HzK6vZ9M8dMF+PNMjoKai6TefMgIqJaa
=jjnj
-----END PGP MESSAGE-----

v6 PKESK + v2 SEIPD

-----BEGIN PGP MESSAGE-----

wWwGBhLIPx5wb2MI/hUaQXdDofAzeQ6T6ZeEiNHbN42pkwiFGRkbc7CERFxtp3hNrvPGM7A0rNqt
PLPl67KOPdZLvQhsKCVoFm4emqRDRZ2TeWfolTMJa5d0bZC6V0JHUHLkSs747AIMq+5OVxrSwD4C
CQIMZWEmBspjdfV9n7XHCI+saNUI3GGaxz0EWpDvaFkMnaS+bpY/PV4lUt9Dcvtz+CXQS7W3hrDA
zobraY+HG5VzeUrAk96ZnNT4qbUD8QGC6I6wnfhovHvCFfmieH939qQ06coo7PL19VKfBtaSb5S3
REO2eVOJQh6XN3HmuSqqgGHT37NoAC//pXAdJnU8X+GqEL8ao1047wYHWcaa1cuRDzUr1yMxBuMX
bdpz02X0EukW1qnhZ4PxnXk26sBPqWFjH9jqdOjVcFK0s37WX6Xw6p+/+SqPpr2iIiPTQPl7hqkM
wFjOUnk+EOmVYnBNltQw/9859oJw2camyw==
=jkAr
-----END PGP MESSAGE-----

@TJ-91
Copy link
Collaborator

TJ-91 commented Apr 13, 2023

New test vectors at commit 7e6a5d3

v6 PKESK + v2 SEIPD

-----BEGIN PGP MESSAGE-----

wWwGBhLIPx5wb2MI/hUaQXdDofAzeQ6T6ZeEiNHbN42pkwiFGdDU+AVuOX24qYAftylAGBedTokQ
gTHLdUMHj7NMdtxvKGCdgxibASYy6+5s0CoHxIFN9nrfCzdjAtDAxT5Xxuwpyjo/cdKwctrSwD0C
CQIMCwJkT+lMlC9zpURVbphYpUw6bh+O+9g5RCjFeEegZDmiUYsmqmhh9DBNuhD2VcIaRU64Mm8E
DXY2w4Ir/10NKX/p6MN97oeJqsEft2Je8STR8QDIB44DjD3RNOmiwMPFK97S5LCKNJFfOdLN96Wi
4UjixlXmSO9aux2F/JuOjhxmQFeUmTDN8p3DXrx0hZtjtMNm2vCYmT29Eob4yt4O2ULcMMWwFsgF
FcAzxwVVupRqtBH2VDeg14cwT0s8rzp3gRlG4Qsa4IXL5IedQazCyBzauhRFFoKLhW+9QI6lk7vz
F9HBGFYQVwh1YqWEahZ+qqz+zvF48WZH
=Y9Dz
-----END PGP MESSAGE-----

Session Key:

94 E3 81 99 71 6F 82 DB B2 0A C2 DA 79 60 9D 60 46 DD 6A C8 8C 42 59 16 0E 40 68 D1 29 8A B6 29

@TJ-91
Copy link
Collaborator

TJ-91 commented Apr 26, 2023

New test vectors at commit 9e820e4

v6 PKESK + v2 SEIPD

-----BEGIN PGP MESSAGE-----

wWwGBhLIPx5wb2MI/hUaQXdDofAzeQ6T6ZeEiNHbN42pkwiFGV6u2cBu1I3WWL+9QCwBZhsWT1de
29lzVcOk2whKB0YaKASCgXvLDUWzOtc4L/XGFrT8BneU1oQbFQ/Du0zLXx0o0soORYXAbG/SwD0C
CQIMBP6H/FXbpqS7Xs5InDZXRfxs6daF5iiNKCArsLqXZ3yIOlTGMSiVzHVumzZjEszevlKA4m5i
Bza38SGDJrzphiKcIwhlItcAbknNfAB4aHom8ezTd7k1+123JQfKy/dUdnWJsTfDAStXtDI7nsmo
G0tIMRg62WpufrK+r4EPx9BdRsfaDEUqJH1Jv9isY+U1xZKUg3bNgms9HHbH2jzuYc6UEDhUe0CY
Amx+xFBE9l2XXmD42S0DbLSSGz0iZRQoIQ9zEkvhvp9LcCnDERB9GZyKL2gY+UmK1uWrQX31PFC/
qIiywOPxvTW0OyF/UDvWjew2zDEktmz5
-----END PGP MESSAGE-----

Session Key:

8C 43 65 CF 6B F7 4B AA 4D 13 E6 66 E9 F1 F8 79 A4 A6 6B 67 54 1C 40 54 BD 60 5C 98 60 A8 10 1A

commands

rm -rf ~/.rnp
echo "cleartext"  > cleartext_to_enc
./src/rnpkeys/rnpkeys --import-keys ../src/tests/data/test_v6_valid_data/transferable_seckey_v6.asc
./src/rnp/rnp -es --armor --output encrypted.pgp cleartext_to_enc

Verify success:

./src/rnp/rnp --list-packets encrypted.pgp --raw
./src/rnp/rnp -d --output decrypted encrypted.pgp
cat decrypted

Note:

  • On branch cr_pqc__w_output, the session key is included in the output of the encrypt / decrypt commands, otherwise it is identical t the cr_pqc branch (merge new changes if necessary).
  • Currently, we generate the CRC24 line in the ASCII armor. Simply remove the line by hand for now, until No CRC24 Checksum for v6 #24 is implemented.

@falko-strenzke
Copy link
Contributor Author

We will adopt the official crypto-refresh test vectors.

@falko-strenzke falko-strenzke added the test Pertaining to unit tests etc label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Pertaining to unit tests etc
Projects
None yet
Development

No branches or pull requests

2 participants