by lmilcin · 6y ago · 0 comments
If you want to understand crypto imagine getting requirements and having to write an app. You can't run it before it goes to production. You need to understand every detail of the app is correct and you are not going to get any validation.
I like to think that crypto is not development. Development only happens after you did crypto (ie. writing down the process) and it is completely different from development.
I have rolled my own cryptogrophic protocol for transferring keys between devices that was subsequently approved by PCI. We needed the protocol in order to work around peculiarities of the particular HSMs we had and it used "funky" operations like encrypting block of data using 3DES in reverse (ie. using decrypting operation on plaintext block of data) so that it can be then digested by the HSM.
Very simple protocol, took a lot of effort to prove why we need it and to prove we know what we are doing.
Well said.
If you are to implement a sorting algorithm, you'll know immediately whether it works or is fast enough. Crypto doesn't provide this feedback. It's important to get help from others, if you can't tell yourself whether your code works.
Since any program using a cryptographic library is inherently now part of a cryptosystem, this is an incredibly dangerous point of view, because a) programs change, and b) cryptanalysis advances.
> took a lot of effort to prove why we need it and to prove we know what we are doing.
I hope this started by hiring people to prove that you didn’t, because the only path to trust is rejecting the null hypothesis.
These requirements should not be limited to description of how the algorithm works but also to important details like "no logging of any cryptographic material" or "duration of operations should be independent of data being processed or success of the operation".
The general problem with developer approach to crypto is that developers decide they have finished when their piece of code works. That just doesn't work with crypto (or security in general).
As to your second comment I can say that I was the only developer at the company and there was no option for hiring other people. As a developer I try to do the best I can with the situation I am in but CEO level decisions on hiring were generally outside my influence.
Whenever you work on something sensitive and potentially dangerous you generally get into a problem of "how I am going to convince them this is safe". In my case, having math background, the solution I decided to go with was to have a written rigorous proof of correctness of the solution and have two other mathematicians and PCI verify the proof (though I have no illusions PCI auditors went through entire document).
As far as cryptography and security goes it isn't possible to prove anything is safe and secure beyond questioning. I am happy in that I did about as much as I could.
Not necessarily (for the part marked in italics). See all the grief that Telegram gets here in every post about it or related to it.
Feedback on certain implementations does come from well known people in crypto.
For some applications you might get an outside opinion (audit or certification) but these are not typically aimed at checking if you did your job well, rather they check if you meet some kind of requirements. For PCI, for example, there is a questionnaire.
Also the feedback of this kind comes for really egregious mistakes, but the devil is usually in the details.