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

Support protocol version 2 #3

Open
joebandenburg opened this issue Jan 12, 2015 · 6 comments
Open

Support protocol version 2 #3

joebandenburg opened this issue Jan 12, 2015 · 6 comments

Comments

@joebandenburg
Copy link
Owner

It would be good to be interoperable with older clients. Although it would be worth finding out if there are many version 2 clients out there before starting on this.

@CharlesOkwuagwu
Copy link

Hi,

You could require the HKDF constructor to take a version variable then, set iterationStartOffset to either 1 or 0 depending on the version... for a start

I think the HKDF for V3 is more in line with the standard... or is it the other way around?

@CharlesOkwuagwu
Copy link

IT would be good to support both versions just in case

@joebandenburg
Copy link
Owner Author

@CharlesOkwuagwu Absolutely, I've put a few "TODO" comments in the code to indicate where changes would need to be made to support version 2. I don't think it would be too difficult. The biggest unknown is if both the node.js crypto module and WebCrypto support AES-256-CTR with a custom CTR (see libaxolotl-android). They both support counter mode, but it's not entirely clear if node.js supports initialising the counter to a specific value.

@CharlesOkwuagwu
Copy link

@joebandenburg Interesting. I've been toying with porting Axolotl to .net, the full libaxolotl-android seems like over-kill compared to the Web-browser version or, better yet your version. There is no CTR mode in .net at all... that would make V2 support tricky, without a 3rd party lib.

Quick question, you leave Store and Crypto as service interfaces in your implementation.
Where is the concrete implementation for these?

(Over-kill WRT https://github.com/trevp/axolotl/wiki, i've actually come a cross a surprisingly simple python implementation, here on github)

@joebandenburg
Copy link
Owner Author

I think the HKDF for V3 is more in line with the standard... or is it the other way around?

Yes, from my reading of the spec starting with 1 (version 3) is in line with the standard.

I've been toying with porting Axolotl to .net

Awesome :) I'd be very interested to hear your feedback about my code. I've tried to make the implementation as clear as possible to help others understand it. I found Axolotl quite complex initially.

without a 3rd party lib.

You may need a 3rd party library anyway to support Curve25519 and Ed25519, which are required by both versions of the protocol. (They are needed for the calculateAgreement and sign methods on the Crypto interface.)

Quick question, you leave Store and Crypto as service interfaces in your implementation.
Where is the concrete implementation for these?

There aren't any implementations yet. You can see a sort-of node.js implementation in test/unit/FakeCrypto.js, although take note that the calculateAgreement and sign methods are not suitable for a real implementation. I've been pondering including an implementation of Curve25519/Ed25519 in libaxolotl-javascript, so the user doesn't need to provide it themselves.

I will be adding documentation to the README to explain the exact requirements for each method of Crypto interface.

@joebandenburg
Copy link
Owner Author

(Over-kill WRT https://github.com/trevp/axolotl/wiki, i've actually come a cross a surprisingly simple python implementation, here on github)

My implementation, like libaxolotl-android, is specific to TextSecure and therefore has the same "non-standard" bits (WTR https://github.com/trevp/axolotl/wiki).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants