Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This entire subthread started because the github repo here used CBC mode (which was supported by the original writer's crypto library), rather than GCM mode (which was unsupported).

We're well deep into a "professional" discussion about the pros and cons of particular implementation details of cryptography.

------------

Go back to the top. Look at the Github code. See that it uses a crypto-library. What should have the original writer have done differently?

The answer is absolutely not "write their own implementation of GCM". They chose correctly: using a well known, well supported CBC mode of operation with AES. (And IMO, _IF_ CBC mode were unsupported, the correct move would have been to write CBC themselves, as it is far less complex than GCM, which includes GHASH and other such side-channel issues).

There's context to everything. From my understanding of this current situation, the CBC choice was perfectly valid.



This GCM sideshow is a consequence of the project using crypto-js, which is not fit for purpose. If your cryptography library doesn't support any AEADs, replace it with one that does. This is a browser project, so all it actually needs is WebCrypto. The whole discussion on this thread has been super weird. Don't ever encrypt with non-authenticated cipher modes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: