keybase / triplesec

Triple Security for the browser and Node.js

Home Page:https://keybase.io/triplesec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test Vectors (expanded)

SparkDustJoe opened this issue · comments

This isn't an issue so much as a "one file pull request"

I have "exploded" the test vectors to include interim values for others to verify their implementations and for those building new ones to make sure their internal machinations are behaving.

The file is huge because of the large test cases at the end of the file so I've put it up on Gist:

https://gist.github.com/SparkDustJoe/845c6502253f9ff8398a

It should be verified by the developers or others before being added to the repository (peer review). It was generated from decrypting the existing samples from a rough-draft C# implementation I am working on.

Here's the "peppermint patty" example from the website:
"key": "7065707065726d696e74207061747479",
"hmacsha512key": "54342e024d2ea4c67619f2864d71508455cd949d5d65f1333842300e3a1752a76c0240fc6c72c3e5d374a9ee6ff7c47c",
"hmacsha3key": "eb41d1f64f439a0fb6db8075dd0ad3f79abe5cafd7dce8e89525a1eaf13616f4b9422ff7ef89cb8875e3d97f9cf8faa9",
"aeskey": "e088122a07c40595e08e3b934b305938ce897f39ac1962c9f9f34fb058a9791f",
"twofishkey": "3ca4374f12e859763767a890bd4f2a150c85e612ff03fbf6b9f440f2c904f188",
"xsalsa20key": "3a796d0ff4890ae5d183761ce515da213654181a78fc4030daf7da8c9fd55066",
"pt": "2020207e2020204d6178204b726f686e2020207e0a20207468656d617840676d61696c2e636f6d0a0a20207e2020436872697320436f796e6520207e0a6368726973406368726973636f796e652e636f6d0a0a20207e2046696c6970706f2056616c736f726461207e0a202020202066764066696c6970706f2e696f",
"rngoutput": "2b2d6b9e9de7821edce4830ac7132b4171059b300cec74b73570932004d92a6c30ca21c59cf7af8e29cda9d71714d906c609a225c4def06051203a7e669c2e0ce521a63b7f2f5a3b",
"salt": "2b2d6b9e9de7821edce4830ac7132b41",
"aesiv": "71059b300cec74b73570932004d92a6c",
"twofishiv": "30ca21c59cf7af8e29cda9d71714d906",
"xsalsa20iv": "c609a225c4def06051203a7e669c2e0ce521a63b7f2f5a3b",
"afterxsalsa20": "c609a225c4def06051203a7e669c2e0ce521a63b7f2f5a3b799bf6850f772661baa54d7e2a637d5c73a9467f984cda0ec5ad5a138319647a54b6c1971dbd6014aff04156381fa5059b0d44fce125acf2d6380577528efc52466d452bd2926aaa437b4e75fd605596d646cce97585a489a10387c09c12b83333d7c00ca57a317e50d73cb97dfd8a80bd20ceb35c4ff49447552a46",
"aftertwofish": "30ca21c59cf7af8e29cda9d71714d9069e2f9a5c94d56ad0073162fbec70657cae4951e174d3563320eb78853dd25f03ce211bdbcd4c8a4664503e2ccd0e5e604707d64ac6b2774e393abbf77afca77e1f332e7bb9aa2a4b0dbc41229a5a85c9a599d63b27b1ac4427746ab8223d49529a09ac3a660445bfaf3389145dd06382c725dd951ca3e38e750fb6e728edebfcde2f8a9d5a4e7e3e49d56870c22239e877e53ac3",
"afteraes": "71059b300cec74b73570932004d92a6cb97e67d68f3c73862afa2b16b31ddae020cc66ae45ad0c95464b3ffd0d422c826d6817c7dc0a0c7d18b3ff992c0efb3a0448e053304a7d6e3abe465349ccb1a6183f790c412803c2e75d8773311e553a7ec7f3704dc19c6c4c1db21445d8bd519b7e4be49f63d7fefeee0dae40e89def3b9367d4b746f930142ee818e977d0d975679ebd8efda6c16fc34ec876090f169ced384d9bf2d64ae447eae6c47f86b7fc79b25c",
"hmacsha512": "a7c762218ec84f4c965bde7c327b31eace1b9b46fc3fdadcf7ac4ce39df871675b570a8cabdfdb7ae62fe0fc04bd5859dd430d530bbf8ba6083d070f5a9e6ed6",
"hmacsha3": "c76c4d6dd61c810036c750f4f7a9c350211b4d0b810f10cb36429508ef42a4400c5461af1f5f3b207ceb206098d7e1d0081dd4135ce6f6063000b4530ad40679",
"ct": "1c94d7de000000032b2d6b9e9de7821edce4830ac7132b41a7c762218ec84f4c965bde7c327b31eace1b9b46fc3fdadcf7ac4ce39df871675b570a8cabdfdb7ae62fe0fc04bd5859dd430d530bbf8ba6083d070f5a9e6ed6c76c4d6dd61c810036c750f4f7a9c350211b4d0b810f10cb36429508ef42a4400c5461af1f5f3b207ceb206098d7e1d0081dd4135ce6f6063000b4530ad4067971059b300cec74b73570932004d92a6cb97e67d68f3c73862afa2b16b31ddae020cc66ae45ad0c95464b3ffd0d422c826d6817c7dc0a0c7d18b3ff992c0efb3a0448e053304a7d6e3abe465349ccb1a6183f790c412803c2e75d8773311e553a7ec7f3704dc19c6c4c1db21445d8bd519b7e4be49f63d7fefeee0dae40e89def3b9367d4b746f930142ee818e977d0d975679ebd8efda6c16fc34ec876090f169ced384d9bf2d64ae447eae6c47f86b7fc79b25c"

My C# port of TripleSec is now pushed up to GitHub, looking for Peer Review

https://github.com/SparkDustJoe/TripleSecManaged

I guess this issue can be closed, it was only put here as a placeholder. Full permission to use the unchanged contents of my GIST post is granted with attribution.