4 ms·
How can you ever know if encryption is working properly?
by fergie 10y ago
How can you ever know if encryption is working properly?
- adrianN 10y agoSteal very important data from the NSA, encrypt it, wait.
- ddalex 10y agoBut this is certainly not a halting program.... or is it ?
- dogma1138 10y agoRubber hose cryptanalysis, if your adversary has not quarrels using it, make sure that your encryption is not strong enough to mandate employing it.
- adrianN 10y agoFinding out whether your encryption is strong does require some determination.
- yunolisten 10y agosure, let me break out my super computer to crack that for you: https://xkcd.com/538/ https://xkcd.com/538/
- jonathanstrange 10y agoThey will use parallel construction to convict you.
- baby 10y agoStart by trying to decrypt it :o)
- edejong 10y agoTechnically, you'll have to formalize and assert the correctness of (at least) the following components: - All ICs having direct (unlimited) access to memory and/or computation (CPU/DMA/GPU/BIOS) - Boot loader - Operating system - Encryption algorithm - Encryption implementation - User-program used to interface with encryption implementation - Input/output peripherals used for encryption and display - Probably a dozen things I'm forgetting here But that's only the system itself. Obviously, you will need to formalize the relationship of the system with the environment. This means: side-channel attacks, such as timing, electro-magnetic radiation, sound and temperature. Finally, you need to formalize the relationship of the user and whatever is encrypted. The user needs to have an understanding of the limitations of the encrypted channel, the used keys and the algorithms involved: what is the availability, the loss of entropy to attackers and the limitations to what can safely be encrypted?
- marcosdumay 10y agoShort answer is, you don't. That's why people say to not implement your own, but use a widely vetted library. For some trivial tests against a library or application, you use test vectors calculated by hand. Every crypto algorithm has some published vectors out there. That would discover this flaw, but is not enough by a huge margin. In practice, you don't test crypto software beyond the trivial, you review it and proof correctness against the attacks you know.
- rocqua 10y agoWrite your own decryption software, see if that software can undo the encryption. For this to fail one of the following must hold: 1 you made a mistake in your decryption that matches a mistake in the encryption. 2 The encryption scheme allows incorrect cyphertext to decrypt to correct plaintext 3 The encryption software writes more than the supposed cyphertext. 1 requires a mistake on your end, so is hard for malicious entities to abuse. 2 is a feature of the cypher, as such can be defended against in design. 3 can be defended against by observing the encryption software (look for all disk modification and network activity).
- benmmurphy 10y agothe problem with testing encryption in an integration test is that the same input should encrypt to different values each time. this makes testing without some kind of stubbing harder. in terms of automated tests that could have caught this error: 1). you can create a second implementation and check that it properly decrypts the output from the first implementation and check the first implementation will properly decrypt the output from the second implementation. 2) you can create output from what you believe is a known good program. then write an automated test that would decrypt this output. then write an automated test that would perform an encryption and then a decryption. this would catch a problem where the encryption and decryption routines switch to using a hardcoded string because of a bug. warning: 2) only works if the bug doesn't exist when you first write the test. :) 3). you allow the random values that making testing encryption difficult to be stubbed out then you can just encrypt plaintext and check it for equality with the ciphertext. ----> of course there is a lot more issues you should be testing for and google recently released a framework that checks for common implementation errors: https://github.com/google/wycheproof https://github.com/google/wycheproof