loader from loading.io

Bill Buchanan - The 100 Basic Rules of Cryptography (and Secure Programming)

ASecuritySite Podcast

Release Date: 08/10/2023

World-leaders in Cryptography: Leslie Lamport show art World-leaders in Cryptography: Leslie Lamport

ASecuritySite Podcast

Please excuse the poor quality of my microphone, as the wrong microphone was selected.   In research, we are all just building on the shoulders of true giants, and there are few larger giants than Leslie Lamport — the creator of LaTeX. For me, every time I open up a LaTeX document, I think of the work he did on creating LaTeX, and which makes my research work so much more productive. If I was still stuck with Microsoft Office for research, I would spend half of my time in that horrible equation editor, or in trying to integrate the references into the required format, or in...

info_outline
World-leaders in Cryptography: Daniel J Bernstein show art World-leaders in Cryptography: Daniel J Bernstein

ASecuritySite Podcast

Daniel J Bernstein (djb) was born in 1971. He is a USA/German citizen and a Personal Professor at Eindhoven University of Technology and a Research Professor at the University of Illinois at Chicago. At the tender age of 24 — in 1995 — he, along with the Electronic Frontier Foundation — brought a case against the US Government related to the protection of free speech (Bernstein v. United States: ). It resulted in a ruling that software should be included in the First Amendment. A core contribution is that it has reduced government regulations around cryptography. It was a sign of the...

info_outline
World-leaders in Cryptography: Jan Camenisch show art World-leaders in Cryptography: Jan Camenisch

ASecuritySite Podcast

Jan is the CTO and a Cryptographer at DFINITY, and, since 1998, he has consistently produced research outputs of rigour, novelty and sheer brilliance [here]. He was recently awarded the Levchin Prize at Real World Crypto 2024 - along with Anna Lysyanskaya. Jan’s research core happened when he was hosted in the IBM Zurich Research Lab, but has since moved to DFINITY, and is still producing research outputs that are some of the best in the whole of the computer science research area. He has published over 140 widely cited papers and has been granted around 140 patents. Jan has also received...

info_outline
An Interview with Ted Miracco show art An Interview with Ted Miracco

ASecuritySite Podcast

Ted Miracco is the CEO of Approov and which is Scottish/US company that is headquartered in Edinburgh. Miracco has over 30 years of experience in cybersecurity, defence electronics, RF/microwave circuit design, semiconductors and electronic design automation (EDA). He co-founded and served as CEO of Cylynt, which focuses on intellectual property and compliance protection

info_outline
World-leaders in Cybersecurity: Troy Hunt show art World-leaders in Cybersecurity: Troy Hunt

ASecuritySite Podcast

Troy is a world-leading cybersecurity professional. He created and runs the Have I Been Pwned? Web site, and which contains details of the most significant data breaches on the Internet.  Along with this, he has developed other security tools, such as ASafaWeb, which automated the security analysis of ASP.NET Web sites. Troy is based in Australia and has an extensive blog at

info_outline
The Greatest Step Change in Cybersecurity Ever! Welcome to the New and Scary World of Generative AI and Cybersecurity show art The Greatest Step Change in Cybersecurity Ever! Welcome to the New and Scary World of Generative AI and Cybersecurity

ASecuritySite Podcast

This is Day 0 of a new world of cybersecurity. Everything changes from here. There will be a time before Generative AI (GenAI) in cybersecurity and a time after it. Over the last two years, GenAI has come on leaps and bounds, and where it once suffered from hallucinations, took racist and bigoted approaches, and often was over-assertive, within ChatGPT 4.5, we see the rise of a friendly and slightly submissive agent, and that is eager to learn from us. This LLM (Large Language Model) approach thus starts to break down the barriers between humans and computers and brings the opportunity to gain...

info_outline
Towards the Memex: All Hail The Future Rulers of our World show art Towards the Memex: All Hail The Future Rulers of our World

ASecuritySite Podcast

And, so George Orwell projected a world where every single part of our lives was monitored and controlled by Big Brother. Arthur C Clark outlined the day when machines focused solely on a goal — even if it was to the detriment of human lives. And, Isaac Asimov outlined a world where machines would have to be programmed with rules so that they could not harm a human. The Rise of the Machine With the almost exponential rise in the power of AI, we are perhaps approaching a technological singularity — a time when technological growth becomes uncontrollable and irreversible, and which can have...

info_outline
World-leaders in Cryptography: Marty Hellman (March 2024) show art World-leaders in Cryptography: Marty Hellman (March 2024)

ASecuritySite Podcast

This seminar series runs for students on the Applied Cryptography and Trust module, but invites guests from students from across the university. Martin is one of the co-creators of public key encryption, and worked alongside Whitfield Diffie in the creation of the widely used Diffie-Hellman method. In 2015, he was presented with the ACM Turing Award (the equivalent of a Nobel Prize in Computer Science) for his contribution to computer science. He is currently a professor emeritus at Stanford University. https://engineering.stanford.edu/node/9141/printable/print  

info_outline
World-leaders in Cryptography: Vincent Rijmen (March 2024) show art World-leaders in Cryptography: Vincent Rijmen (March 2024)

ASecuritySite Podcast

Vincent Rijmen is one of the co-creators of the NIST-defined AES standard (also known as Rijndael). He also co-designed the WHIRLPOOL hashing method, along with designing other block ciphers, such as Square and SHARK. In 2002, Vincent was included in the Top 100 innovators in the world under the age of 35, and, along with Joan Daemen, was awarded the RSA Award for Excellence in Mathematics. He recently joined Cryptomathic as a chief cryptographer, and also holds a professor position (gewoon hoogleraar) at K.U.Leuven, and adjunct professorship at the University of Bergen, Norway. His paper on...

info_outline
World-leaders in Cryptography: Whitfield Diffie show art World-leaders in Cryptography: Whitfield Diffie

ASecuritySite Podcast

Whitfield Diffie is one of the greatest Computer Scientists ever. He - along with Marty Hellman - was one of the first to propose the usage of public key encryption and co-created the Diffie-Hellman (DH) key exchange method. Overall, the Diffie-Hellman method is still used in virtually every Web connection on the Internet, and has changed from using discrete log methods to elliptic curve methods. In 2015, Whitfield was also awarded the ACM Turing Prize - and which is the Nobel Prize equivalent in Computer Science.  In this on-line talk he meets with Edinburgh Napier University students,...

info_outline
 
More Episodes

Kerckhoff’s principle defines that “a Cryptographic system should be designed to be secure, even if all its details, except for the key, are publicly known”, but there aren’t too many other rules defined. So here are my 100 Basic Rules of Cryptography (and Secure Programming). First, my Top 10:

  1. Cryptography is both an art and a science.
  2. Cryptography needs to be both theoretical and practical — one without the other leaves gaps.
  3. The maths is not actually that difficult — it is just the way that researchers talk about it that is a problem.
  4. Know your knowledge gaps — and plug them.
  5. Your university education is unlikely to have properly set you up for the serious world of cryptography.
  6. Crypto is cryptography and not cryptocurrency.
  7. Few methods are perfect — know the limits of any method you use.
  8. Don’t cook your own crypto! How many times do you have to say this to yourself?
  9. Security-by-obfuscation never works that well.
  10. Confidentiality, Integrity and Assurance are different things and require different methods. Don’t merge them all together into one thing.

And the rest:

  1. Digital certificates and PKI (Public Key Infrastructure) are two of the least understood areas of cybersecurity — don’t expect many people to understand them.
  2. For public key encryption, you encrypt with Alice’s public key, and she decrypts with her private key.
  3. For public key signatures, you sign a hash of the message with your private key, and Alice proves your public key.
  4. Your baseline hack is always brute force. Know how many dollars it would cost the NSA to crack something.
  5. Machine code can reveal your secrets.
  6. A hack of one key should not lead to the loss of all the previous keys.
  7. A key should only exist for the time it was meant to exist for.
  8. Use session keys wherever possible, and watch out for long-term keys.
  9. Your role is typically to protect the user and not reveal things to the NSA.
  10. Listen to experts, and be a teacher to others. Be open with your knowledge, and don’t pretend you know something that you don’t.
  11. Try and understand the basics of the maths involved — otherwise, you are trusting others.
  12. Understand entropy, and know how to calculate it and prove it with experiments.
  13. Run entropy calculations before pushing related code to production.
  14. Don’t use a method unless it has been peer-reviewed and published.
  15. Understand the strengths and weaknesses of your methods. No method is perfect —but at least know what problems it might cause and try and mitigate against these.
  16. Know why you have chosen X over Y, and be able to defend the reason to others.
  17. The maths may be sound, but human is typically the main weakness.
  18. Everything will work fine until it doesn’t.
  19. Test for out-of-band conditions as much for good conditions.
  20. Zero is not your friend in cryptography, so always know what it will do to your system.
  21. Don’t just catch exceptions; action them. Do not allow to progress unless everything checks out okay.
  22. Log good and bad. Catch good things, along with bad things.
  23. Monitor your security logs for exceptions and bad operations.
  24. Remove debugging code from your production version.
  25. Keep up to date with the latest research.
  26. Beware of backdoors in methods and code.
  27. Side channels are smart ways to reveal the 1s and 0s, and every bit discovered reduces the security level by two and makes it so much less expensive to crack. Every bit drops the price tag for a crack by a half.
  28. The core security of your system is likely to depend on the generation of random oracles (seed values). Make sure they are generated so they do not repeat within a given time and cannot be brute forced by the NSA.
  29. If you can use real randomisation and not pseudo-randomness.
  30. If you generate pseudo-randomness, take the randomness from several sources.
  31. Continually review your code, and get external experts to review it.
  32. Don’t push your code in production until you have tested it — fully!
  33. Check the code in the libraries you use, and perhaps, don’t use them if there are no open-source repositories.
  34. If you can, open source your libraries.
  35. Watch out for version updates on your code, and try and lock a given (known) version to your code.
  36. Encrypt anything that looks like PII (Personally Identifiable Information) at rest and over the air.
  37. Remember that running memory can reveal keys and cryptographic artefacts, so know the risk.
  38. Learn a new method every day, and don’t get stuck with the same old crypto!
  39. Quantum computers will happen one day and will disrupt our life, so start thinking about the impact they might have.
  40. Revealing your private keys is like giving someone the keys to your castle, so know where they are and restrict access to them.
  41. Only give access to private keys to those you most trust to use them properly.
  42. Air your development environment from your production environment, and don’t let private keys propagate.
  43. The best systems use zero trust. No rights to anything unless they can be proven.
  44. You will — at times — need to revoke your public keys. Be aware of the processes involved and of the embarrassment it will cause.
  45. Educate the board on the importance of good crypto!
  46. Encourage your team to undertake academic study, and get them to reserve a few hours a week for independent study of new methods.
  47. Read classic research papers, and don’t dismiss methods because they are not currently used.
  48. Collaborate with an academic team which has complementary skills to your own team.
  49. If you lack theoretical knowledge in your team, get external experts to come in for a chat.
  50. Once a private key is destroyed, any data encrypted with it is also likely to be destroyed.
  51. Limit the copies of a secret key.
  52. If you can, keep your keys in an HSM (Hardware Security Module).
  53. Cryptography in the Cloud pushes you to the limits and will often enhance the methods you use.
  54. Back up those secret keys, but make sure they are well-wrapped before putting them in a place that others can access.
  55. Learn about the garbage collector and how your program deals with data when running.
  56. Leave the coding of the maths in papers to experts.
  57. Don’t trust auditors to prove the security of your system.
  58. Generally, auditors are likely to have little understanding of the methods you will use — get experts to review your methods.
  59. Beware of Denial of Service (DoS) on your code — such as continual exception handling.
  60. Most systems boil down to one single thing that defines the overall security — know what this is.
  61. If you are interested in the X method, go and contact the person that created it — you will often be surprised how open many researchers are in sharing their ideas.
  62. Watch those CVE updates like a hawk — it can be a race between you and your adversary.
  63. On Cloud-based systems, log everything about your keys.
  64. In the Cloud, only allow keys to be used for the purpose they should be used for, and don’t use them generally.
  65. Limit access to keys for services and roles.
  66. Reduce the impact of a stolen or lost secret key.
  67. Never encrypt large-scale data infrastructures with the same secret key — try to use envelope encryption.
  68. Passwords are dead — replace with cryptographic signing methods.
  69. Your enemy can be within. Watch out for key stealing and deletion.
  70. Tell your incident response team about the difference between losing encrypted data and non-encrypted data.
  71. Scan your network for secret keys placed in locations where they should not be stored.
  72. Know what the acronyms mean and not just what they stand for.
  73. Know why we use message authentication codes (MACs).
  74. If you need to generate an encryption key from a password or secret, pick a good KDF (Key Derivation Function), and know the cost to crack it.
  75. Rainbow tables aren’t much of a threat anymore, so make use your use a good salt value.
  76. Everything below 72 bits of entropy is likely to be crackable by the NSA — unless a slow method is used for the processing with the key.
  77. Nonce/salt values should start at 96 bits. Never use anything less.
  78. RC4 has been cracked … get over it.
  79. Stream ciphers can often be broken — make sure you never reuse your salt value.
  80. DES and 3DES are mainly uncracked, but DES only uses a 56-bit key, so never use it
  81. Compared with ECC, RSA requires a good deal more processing and has larger key sizes, but it is still great.
  82. ECDSA suffers from nonce reuse attacks.
  83. For digital signatures, you should delete the nonce value after the signature has been created, but for symmetric key and hashing, you need to store it.
  84. In ECC, the public key is a point on the elliptic curve. For secp256k1, we have a 256-bit private key and a 512-bit (x,y) point for the public key. A “04” in the public key is an uncompressed public key, and “02” and “03” are compressed versions with only the x-co-ordinate and whether the y coordinate is odd or even.
  85. Consider writing papers — it is a great way to develop your writing and abstraction skills.
  86. Don’t sit back with the status quo — try to continually improve privacy and security.
  87. Have a risk register and maintain it. Don’t be shy, and don’t hide things.
  88. Have someone to check your code — on a regular basis.
  89. Remember Moore’s Law … computing power is increasing every year, so know that something that is safe now might not be in 10 years.
  90. Know how long something needs to be kept secure and secure for that age (and a lot more).

And there you go … 100 rules of cryptography