appassionato, to books
@appassionato@mastodon.social avatar

The Code Book: The Secrets Behind Codebreaking by Simon Singh

Based on The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography , this version has been abridged and slightly simplified for a younger audience.From Julius Caesar to the 10th-century Arabs; from Mary Queen of Scots to "Alice and Bob"; from the Germans' Enigma machine to the Navajo code talkers in World War II, Singh traces the use of code to protect--and betray--secrecy.

@bookstodon
#books
#cryptography

Edent, (edited ) to random
@Edent@mastodon.social avatar

I need to store the hash of a file.

For various boring reasons, I only have 128 bits of space. This cannot be changed.

Is it better to use MD5, or truncate the output of SHA-256 / 512 ?

Please argue in the replies.

Edent,
@Edent@mastodon.social avatar

On a related note, I'm sure I read a paper / post where someone proved that you could manipulate a file to produce a hash where the first and last few characters matched the hash of an unrelated file.

Anyone know what I'm talking about?

#Cryptography #Security

fj, to random
@fj@mastodon.social avatar

When Thomas Oliver and Kyu-Hwan Lee used machine learning techniques to predict the ranks of elliptic curves with high accuracy, they noticed hidden oscillations reminiscent of bird murmurations. That pattern was not noticed by mathematicians before, and an explicit formula for those was found by Nina Zubrilina.

https://www.quantamagazine.org/elliptic-curve-murmurations-found-with-ai-take-flight-20240305/

image/jpeg

indianewswatch, to Cybersecurity

Critical security flaws exposed in 2 government cybersecurity apps, CERT-In raises alarm

CERT-In said that the two applications, USB Pratirodh and AppSamvid, were using weak cryptographic algorithms.

#cybersecurity #infosec #CERTIn #CDAC #cryptography #security #UnionGovt #india

https://www.moneycontrol.com/news/technology/critical-security-flaws-exposed-in-2-government-cybersecurity-apps-cert-in-raises-alarm-12410331.html

Taffer, to random
@Taffer@mastodon.gamedev.place avatar

Got excited this morning and started a new repo for cryptopals.com at https://codeberg.org/Taffer/cryptopals

Going to do Python and C, and try to get better at Go and Rust, and maybe finally learn Ruby.

Odds are I won’t have time to get far, but it’s the thought that counts, right?

#cryptopals #cryptography

krinkle, (edited ) to random
@krinkle@fosstodon.org avatar

Difficult.

Difficult is a cult centered around the exchange of Diffie–Hellman public keys. Its members are primarily known for their interest in obscure cryptographic inventions.

#FakeDefinitions #cryptography

conansysadmin, to Cybersecurity
@conansysadmin@mstdn.social avatar

A warrior always has more to learn. Especially about the wizardry of . https://cromwell-intl.com/cybersecurity/crypto/reading.html?s=mc

element, to rust
@element@mastodon.matrix.org avatar

🚀 Exciting News! 🚀

We're consolidating our cryptographic libraries with Rust! 🦀

With a unified crypto library, we simplify development, speed up deployment, and ensure consistent security measures across all clients.

This milestone marks a significant step in our journey.

Join us in celebrating this achievement, and looking forward to even more exciting developments ahead! 🎉

https://element.io/blog/meet-element-r-our-new-unified-crypto-implementation/

islamicaudiobooks,
@islamicaudiobooks@mastodon.social avatar

@niklaskorz @epicEaston197 @element Even better to use hashtag ... you know for more reach ;)

Edent, to fediverse
@Edent@mastodon.social avatar

🆕 blog! “A simple(ish) guide to verifying HTTP Message Signatures in PHP”

Mastodon makes heavy use of HTTP Message Signatures. They're a newish almost-standard which allows a server to verify that a request made to it came from the person who sent it. This is a quick example to show how to verify these signatures using P…

👀 Read more: https://shkspr.mobi/blog/2024/02/a-simpleish-guide-to-verifying-http-message-signatures-in-php/

#ActivityPub #cryptography #http #mastodon #security

soatok, to random

There is, at the time of this writing, an ongoing debate in the Crypto Research Forum Group (CFRG) at the IETF about KEM combiners.

One of the participants, Deirdre Connolly, wrote a blog post titled https://durumcrustulum.com/2024/02/24/how-to-hold-kems/. The subtitle is refreshingly honest: “A living document on how to juggle these damned things.”

Deirdre also co-authored the paper describing a Hybrid KEM called X-Wing, which combines X25519 with ML-KEM-768 (which is the name for a standardized tweak of Kyber, which I happened to opine on a few years ago).

After sharing a link to Deirdre’s blog in a few places, several friendly folk expressed confusion about KEMs in general.

So very briefly, here’s an introduction to Key Encapsulation Mechanisms in general, to serve as a supplementary resource for any future discussion on KEMs.

You shouldn’t need to understand lattices or number theory, or even how to read a mathematics paper, to understand this stuff.

Grin StickerCMYKat

Building Intuition for KEMs

For the moment, let’s suspend most real-world security risks and focus on a simplified, ideal setting.

To begin with, you need some kind of Asymmetric Encryption.

Asymmetric Encryption means, “Encrypt some data with a Public Key, then Decrypt the ciphertext with a Secret Key.” You don’t need to know, or even care, about how it works at the moment.

Your mental model for asymmetric encryption and decryption should look like this:

interface AsymmetricEncryption {  encrypt(publicKey: CryptoKey, plaintext: Uint8Array);  decrypt(secretKey: CryptoKey, ciphertext: Uint8Array);}

As I’ve written previously, you never want to actually use asymmetric encryption directly.

Using asymmetric encryption safely means using it to exchange a key used for symmetric data encryption, like so:

// Alice sends an encrypted key to BobsymmetricKey = randomBytes(32)sendToBob = AsymmetricEncryption.encrypt(    bobPublicKey,    symmetricKey)// Bob decrypts the encrypted key from Alicedecrypted = AsymmetricEncryption.decrypt(    bobSecretKey,    sendToBob)assert(decrypted == symmetricKey) // true

You can then use symmetricKey to encrypt your actual messages and, unless something else goes wrong, only the other party can read them. Hooray!

And, ideally, this is where the story would end. Asymmetric encryption is cool. Don’t look at the scroll bar.

Speechless StickerCMYKat

Unfortunately

The real world isn’t as nice as our previous imagination.

We just kind of hand-waved that asymmetric encryption is a thing that happens, without further examination. It turns out, you have to examine further in order to be secure.

The most common asymmetric encryption algorithm deployed on the Internet as of February 2024 is called RSA. It involves Number Theory. You can learn all about it from other articles if you’re curious. I’m only going to describe the essential facts here.

Keep in mind, the primary motivation for KEMs comes from post-quantum cryptography, not RSA.

Clipboard StickerCMYKat

From Textbook RSA to Real World RSA

RSA is what we call a “trapdoor permutation”: It’s easy to compute encryption (one way), but decrypting is only easy if you have the correct secret key (the other way).

RSA operates on large blocks, related to the size of the public key. For example: 2048-bit RSA public keys operate on 2048-bit messages.

Encrypting with RSA involves exponents. The base of these exponents is your message. The outcome of the exponent operation is reduced, using the modulus operator, by the public key.

(The correct terminology is actually slightly different, but we’re aiming for intuition, not technical precision. Your public key is both the large modulus and exponent used for encryption. Don’t worry about it for the moment.)

If you have a very short message, and a tiny exponent (say, 3), you don’t need the secret key to decrypt it. You can just take the cube-root of the ciphertext and recover the message!

That’s obviously not very good!

To prevent this very trivial weakness, cryptographers proposed standardized padding schemes to ensure that the output of the exponentiation is always larger than the public key. (We say, “it must wrap the modulus”.)

The most common padding mode is called PKCS#1 v1.5 padding. Almost everything that implements RSA uses this padding scheme. It’s also been publicly known to be insecure since 1998.

The other padding mode, which you should be using (if you even use RSA at all) is called OAEP. However, even OAEP isn’t fool proof: If you don’t implement it in constant-time, your application will be vulnerable to a slightly different attack.

This Padding Stinks; Can We Dispense Of It?

It turns out, yes, we can. Safely, too!

We need to change our relationship with our asymmetric encryption primitive.

Instead of encrypting the secret we actually want to use, let’s just encrypt some very large random value.

Then we can use the result with a Key Derivation Function (which you can think of, for the moment, like a hash function) to derive a symmetric encryption key.

class OversimplifiedKEM {  function encaps(pk: CryptoKey) {    let N = pk.getModulus()    let r = randomNumber(1, N-1)    let c = AsymmetricEncryption.encrypt(pk, r)    return [c, kdf(r)]  }  function decaps(sk: CryptoKey, c: Uint8Array) {    let r2 = AsymmetricEncryption.decrypt(sk, c)    return kdf(r2)  }}

In the pseudocode above, the actual asymmetric encryption primitive doesn’t involve any sort of padding mode. It’s textbook RSA, or equivalent.

KEMs are generally constructed somewhat like this, but they’re all different in their own special, nuanced ways. Some will look like what I sketched out, others will look subtly different.

Understanding that KEMs are a construction on top of asymmetric encryption is critical to understanding them.

It’s just a slight departure from asymmetric encryption as most developers intuit it.

Cool, we’re almost there.

High Paw (high five) stickerCMYKat

The one thing to keep in mind: While this transition from Asymmetric Encryption (also known as “Public Key Encryption”) to a Key Encapsulation Mechanism is easy to follow, the story isn’t as simple as “it lets you skip padding”. That’s an RSA specific implementation detail for this specific path into KEMs.

The main thing you get out of KEMs is IND-CCA security, even when the underlying PKE mechanism doesn’t offer that property.

What Are You Feeding That Thing?

Deirdre’s blog post touched on a bunch of formal security properties for KEMs, which have names like X-BIND-K-PK.

Most of this has to deal with, “What exactly gets hashed in the KEM construction at the KDF step?”

For example, from the pseudocode in the previous section, it’s more secure to not only hash r, but also c and pk, and any other relevant transcript data.

class BetterKEM {  function encaps(pk: CryptoKey) {    let N = pk.getModulus()    let r = randomNumber(1, N-1)    let c = AsymmetricEncryption.encrypt(pk, r)    return [c, kdf(pk, c, r)]  }  function decaps(sk: CryptoKey, c: Uint8Array) {    let pk = sk.getPublickey()    let r2 = AsymmetricEncryption.decrypt(sk, c)    return kdf(pk, c, r2)  }}

In this example, BetterKem is greatly more secure than OversimplifiedKEM, for reasons that have nothing to do with the underlying asymmetric primitive. The thing it does better is commit more of its context into the KDF step, which means that there’s less pliability given to attackers while still targeting the same KDF output.

If you think about KDFs like you do hash functions (which they’re usually built with), changing any of the values in the transcript will trigger the avalanche effect: The resulting calculation, which is not directly transmitted, is practically indistinguishable from random bytes. This is annoying to try to attack–even with collision attack strategies (birthday collision, Pollard’s rho, etc.).

However, if your hash function is very slow (i.e., SHA3-256), you might be worried about the extra computation and energy expenditure, especially if you’re working with larger keys.

Specifically, the size of keys you get from ML-KEM or other lattice-based cryptography.

That’s where X-Wing is actually very clever: It combines X25519 and ML-KEM-768 in such a way that binds the output to both keys without requiring the additional bytes of ML-KEM-768 ciphertext or public key.

X-Wing shared secrets are defined as the SHA3-256 hash of a domain separation constant (6 bytes) the ML-KEM-768 shared secret (32 bytes), X25519 ephemeral public key (32 bytes), X25519 shared secret (32 bytes), and the recipient's X25519 public key, This means the performance cost is fixed at 134 bytes of SHA3.From the X-Wing paper.

However, it’s only secure to use it this way because of the specific properties of ML-KEM and X25519.

Some questions may come to mind:

  1. Does this additional performance hit actually matter, though?
  2. Would a general purpose KEM combiner be better than one that’s specially tailored to the primitives it uses?
  3. Is it secure to simply concatenate the output of multiple asymmetric operations to feed into a single KDF, or should a more specialized KDF be defined for this purpose?

Well, that’s exactly what the CFRG is debating!

galaxy brain stickerCMYKat

Closing Thoughts

KEMs aren’t nearly as arcane or unapproachable as you may suspect. You don’t really even need to know any of the mathematics to understand them, though it certainly does help.

I hope that others find this useful.


Header art by Harubaki and AJ.

https://soatok.blog/2024/02/26/kem-trails-understanding-key-encapsulation-mechanisms/

conansysadmin, to random
@conansysadmin@mstdn.social avatar

If a monastery filled with monks calculated forever, would they discover all possible numbers? #cryptography https://cromwell-intl.com/cybersecurity/crypto/hash-search.html?s=mc

jschauma, to random
@jschauma@mstdn.social avatar

Apple goes post-quantum crypto for iMessage, using their new "PQ3" protocol (ML-KEM / Kyber + ECDH for key exchange with periodic (PQC) rekeying:

https://security.apple.com/blog/imessage-pq3/

They also had outside experts do analyses of their new protocol:

https://security.apple.com/assets/files/Security_analysis_of_the_iMessage_PQ3_protocol_Stebila.pdf
https://security.apple.com/assets/files/A_Formal_Analysis_of_the_iMessage_PQ3_Messaging_Protocol_Basin_et_al.pdf

#cryptography #postquantum #pqc

Tutanota, to ai
@Tutanota@mastodon.social avatar

After #AI, quantum computers will be next big thing in tech.

And they'll be able to break currently used email #encryption.

Plus, the NSA already uses "harvest now, decrypt later" strategies.

That's why we at Tuta are working on post-quantum #cryptography. 🔒💪

Read everything you need to know about this amazing journey:
https://tuta.com/blog/post-quantum-cryptography

fj, to random
@fj@mastodon.social avatar

Recursive SNARKs go post-quantum:
“we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK.”

LatticeFold supports low-degree relations (R1CS) as well as high-degree relations (CCS) and is considered as performant as Hypernova but with post-quantum security.

https://eprint.iacr.org/2024/257

#PQC #ZeroKnowledgeProofs #ZKPs #Cryptography

conansysadmin, to Cybersecurity
@conansysadmin@mstdn.social avatar

None can be a #cybersecurity warrior without knowing the basics of #cryptography. https://cromwell-intl.com/cybersecurity/crypto/?s=mc

tu_muenchen, to Cybersecurity
@tu_muenchen@wisskomm.social avatar

With seven new research projects on #cybersecurity and #ArtificialIntelligence being launched at our university in cooperation with Google, we will continue to explore topics such as #LLMs and #postquantum #cryptography: http://go.tum.de/232497

📷A.Eckert

hannesm, to programming
@hannesm@mastodon.social avatar
br00t4c, to random
@br00t4c@mastodon.social avatar
br00t4c, to random
@br00t4c@mastodon.social avatar

A Celebrated Cryptography-Breaking Algorithm Just Got an Upgrade

#cryptography

https://www.wired.com/story/cryptography-algorithm-upgrade-security/

nono2357, to linux

The Foundation Creates an Alliance to Work On Post- https://news.itsfoss.com/linux-foundation-quantum/

alvinashcraft, to Cybersecurity
@alvinashcraft@hachyderm.io avatar

There are 16 days left on the 2024 eBook bundle from Packt Publishing and Humble Bundle. Pay $18 or more for 23 titles. Pay less for 7 or 3 books.


https://www.humblebundle.com/books/cybersecurity-2024-from-packt-books?partner=morningdew

sjvn, to random
@sjvn@mastodon.social avatar

The Linux Foundation and its partners are working on cryptography for the post-quantum world https://zdnet.com/article/cryptography-for-the-post-quantum-world/ by @sjvn

The good news: #quantum computing will bring a new level of speed. The bad news: it will break today's #cryptography.

meghana, to infosec

Random question — but has anyone worked with or researched in Attribute Based Credentials? I have been reading about them for my research and I feel like I’m going in circles at this point trying to find one that would fit my requirements? Needed someone to ask some questions (they might be kinda dumb questions because I think I’m not understanding something about bilinear maps) #infosec #cryptography

skribe, to coursera
@skribe@aus.social avatar

I'm doing some research for my WiP by retaking the Coursera Cryptography course. I think it hasn't been updated in the 10 or so years since I last did it.

The lecturer actually references TrueCrypt as an example of disk encryption. TrueCrypt was abandoned in 2014 for reasons unknown. It's considered unsafe.

simonzerafa, to random

On the 80th anniversary If you are interested in learning about Colossus and how it was used to decode Lorenz SZ40 encrypted traffic during WWII.

Some elements of the design are fascinating and predate much later design of computers for speed and ingenuity.

The following is a talk by Chris Shore at the Centre for Computing History which gives the story and operation of Colossus in some detail 😀

https://www.youtube.com/watch?v=g2tMcMQqSbA

[1h 00']

The rebuild of Colossus is on display at The National Museum of Computing at Bletchley and is well with a visit.

image/jpeg

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • cubers
  • osvaldo12
  • mdbf
  • magazineikmin
  • normalnudes
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • khanakhh
  • ethstaker
  • Leos
  • ngwrru68w68
  • everett
  • cisconetworking
  • tacticalgear
  • anitta
  • thenastyranch
  • Durango
  • tester
  • GTA5RPClips
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines