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 #crypto... you know for more reach ;)
#cryptography #rust #rustlang #matrix

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 warrior without knowing the basics of . 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 #Linux Foundation Creates an Alliance to Work On Post-#Quantum #Cryptography 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)

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

sanjaymenon, to infosec
@sanjaymenon@mastodon.social avatar
fj, (edited ) to random
@fj@mastodon.social avatar

.@bsi + French ANSSI + NLNCSA + Swedish NCSA: #QKD can only be used in very niche use cases. Priority is to migrate to Post-Quantum Cryptography.
https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Crypto/Quantum_Positionspapier.html

EU Commission: Let's invest in QKD / Quantum Cryptography for “Economic Security"

#Quantum #Cryptography #PQC

RonaldTooTall, to privacy
YourAnonRiots, to random Japanese
@YourAnonRiots@mstdn.social avatar

Core cryptographic algorithms can stand up to evolving cyberattacks right now, but for how much longer?

In the first part of our post-quantum #cryptography series, we look at contemporary cryptography and how #quantumcomputers could change it all: ⬇️
https://www.trendmicro.com/vinfo/us/security/news/security-technology/diving-deep-into-quantum-computing-modern-cryptography?utm_source=trendmicroresearch&utm_medium=smk&utm_campaign=0923_quantumcrypto1

jake4480, to security
@jake4480@c.im avatar

Cryptographers are getting closer to enabling fully private Internet searches 🔗 https://archive.is/AsYSP

#security #privacy #cryptography #internet #search #news

jeruyyap, to ChatGPT
@jeruyyap@hachyderm.io avatar

I will continue to refuse to call cryptocurrency "crypto" and refuse to call things like ChatGPT "AI".

I'm very disappointed in the rest of ya'll who have caved on this.

I tend to be very disappointed in general.

jeruyyap,
@jeruyyap@hachyderm.io avatar

"But AI is short and easy and technically..."

No, LLMs already have an acronym that's just three letters/syllables. The only reason you'd use "AI" to refer to an LLM is to misrepresent it as being more general than it is and I'm not interested in helping grifters by propagating that deception.

#Chatgpt #Cryptocurrency #Artificialintelligence #Llm #Cryptography

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