/r/crypto
Cryptography is the art of creating mathematical assurances for who can do what with data, including but not limited to encryption of messages such that only the key-holder can read it. Cryptography lives at an intersection of math and computer science.
This is a technical subreddit covering the theory and practice of modern and strong cryptography.
... is the art of creating mathematical / information theoretic assurances for who can do what with data, including but not limited to the classical example of encrypting messages so that only the key-holder can read it. Cryptography lives at an intersection of math and computer science.
This subreddit is intended for links and discussions surrounding the theory and practice of modern and strong cryptography.
Please note that this subreddit focused on the tech, not politics! The focus is on the algorithms and the security of the implementations.
Because this subreddit currently is in restricted mode, you will NOT be able to post or comment before your account has been approved. Send us a reason for why you want to join via mod mail, click here and tell us why you want to discuss cryptography;
(along with normal reddiquette)
Don't forget to read our RULES PAGE! The rules listed there are also used as this sub's report reasons. The quick version;
Internal:
External:
Other subreddits that may be of interest:
Theory:
Practical:
Educational, hobbyist:
Political and in the news:
Software:
Related:
Memes and low effort submissions:
Feel free to message the moderators with suggestions for how to improve this subreddit, as well as for requesting adding links in the sidebar.
/r/crypto
I recently noticed that TLS libraries exist that are specialized for embedded devices. Such libraries exist since other more popular TLS libraries (e.g. OpenSSL) have too large a footprint to be suitable for use in embedded devices that have low system resources.
I was wondering if anyone here has first-hand experience using TLS libraries designed for embedded devices such as WolfSSL, MbedTLS, SharkSSL, BearSSL, etc.
Why did you start using them?
What were common problems you noticed using these embedded TLS libraries?
I was reviewing cURL's sheet comparing TLS libraries (https://curl.se/docs/ssl-compared.html).
I was surprised when I found only two supporting crypto modules/tokens following the PKCS #11 standard.
Why are there so few TLS libraries supporting crypto modules/tokens operating under the PKCS #11 standard?
What are the optimal secure curves for ECC? I have been using Curve25519 because of https://safecurves.cr.yp.to/ and also want to implement Curve448.
BLS12_381 is another interesting one, especially for zkps.
From what I understand the size of a secp256k1 EC public key is 65 bytes (out of which one is a prefix byte so lets ignore that). The private key is any 256-bit number in [0, N] where N is the order of the curve. So if I have a random 64-byte stream, the probability of it being a valid EC public key on the curve is N / 2^512 = 2^256 / 2^512 = 2^{-256}
. Does this sound right?
Also from some shallow reading you can compress the public key to half the size (32-bytes) by only using one of the (x, y) coordinates due to "special properties of the curve". So then how would I find the probabilty of a random 32-byte stream being a valid EC public key on the (secp256k1) curve? Does the probability remain the same?
Hi. As title goes, I’m getting into cryptography I’d like to know if there’s any online puzzles or beginner ciphers I can try to solve to start getting into this. Thanks
I was reading this paper that claims to "combine metaverse with blockchain", but I have a hard time understanding their use of primitives. On page 4 they first generate the key-pairs (not sure which scheme?):
Then the patient uses his/her private key to sign the data, and then the hospital encrypts it (page 5):
So I'm guessing (pk0, pk1) is probably from Ed25519 but (ak0, ak1) may be from X25519. The patient data is then encrypted using ak0, but isn't that something you aren't supposed to do? The paper doesn't mention the size constraints on patient data either.
It then says that:
The newly generated data has to be validated before they can be added to the blockchain. These data are validated by the admin (doctor, pathologists, radiologists) following the process depicted in figure 5 using the admin private key ak1.
But figure 5 doesn't mention ak1:
What was the point of ak* anyway given that the hospital is the one encrypting the data in the first place? Am I missing something?
Welcome to /r/crypto's weekly community thread!
This thread is a place where people can freely discuss broader topics (but NO cryptocurrency spam, see the sidebar), perhaps even share some memes (but please keep the worst offenses contained to /r/shittycrypto), engage with the community, discuss meta topics regarding the subreddit itself (such as discussing the customs and subreddit rules, etc), etc.
Keep in mind that the standard reddiquette rules still apply, i.e. be friendly and constructive!
So, what's on your mind? Comment below!
Hi, please fill out Lattica's FHE survey https://forms.gle/UA4LrVKhkWgENeGS9. This survey gathers insights from industry experts about the current state and future development of Fully Homomorphic Encryption. Survey results will be widely available here and on social media. Thanks - your insights are super valuable!
Why does the dCode.fr website for Caesar Cipher result in two or more answers for strings I want to decode? Shouldn't there be only one way to shift using key 3? I can't find the answer anywhere. Please help!
Greetings Crypto Sub!
I am dealing with a kind of cryptolocker situation... Not _that_ bad, but kinda bad.
Data that is encrypted out of my reach: ~8 years of Signal Desktop data (including family photos and much else).
How it went beyond reach: In late 2024, Signal Desktop started encrypting its data encryption key using DPAPI. Then, in early 2025, my laptop died. While I have a full file system backup (thank you backblaze!), the old SSD is damaged and dead (I currently have it in an M.2->USB enclosure, imaging apps like Macrium and Acronis fail to image it, repairs like fdisk are not able to fully repair the volume).
IOW: The old Windows OS is not bootable. (If it were, I would be able to use this tool to decrypt the Signal crypto key)
The crypto path is:
(a) Signal Data Encryption key -> (b) Itself encrypted via DPAPI under OldPC -> (c) WinUser1
The puzzle I am trying to solve is (b)
I have dug around the DPAPI world.. My specific context is: OldPC was Win11 but WinUser1 is an "old style" Windows user [e.g. not a microsoft.com account] _and_ I know the Windows Password for that user [as that user was yours truly].
Ideally, there would be an offline DPAPI tool or cracker. I can give it (b) and the Windows Password for (c). I can also provide the raw registry files or other files from the old Windows OS (or potentially extract values from those files).
Is there a possible path forward?
No way they can be, right? (Edit: see comments, problem was between chair and keyboard. Thanks!)
I'm currently writing yet another AES implementation. My goal is to have a bitslice implementation, similar to BearSSL, but with a nicer API. Anyway, right now I'm making a simple, slow, unsafe (variable time) reference implementation, to better understand AES before I do the actual bitslice. So far AES ECB encryption seems to be working, at least according to this nice online tool.
It was time for a more serious test suite, so I searched for official test vectors. I landed on this page, and eventually downloaded these response files. In those I extracted the ECBMCT128.rsp
, wrote a parser, and ran my implementation against it.
It does not work.
Specifically, the very first test got me this:
KEY : 139a35422f1d61de3c91787fe0507afd
PLAINTEXT : b9145a768b7dc489a096b546f43b231f
CIPHERTEXT: d7c3ffac9031238650901e157364c386
RESULT : 0da1b56ba11c1a5500e95583c0eac913
The first 3 lines come from the response file, and the RESULT is what my implementation outputs — it's supposed to match the CIPHERTEXT. They're clearly different, so I guess I botched it. No problem, let's try the online tool I was using before, see what their result is:
0da1b56b a11c1a55 00e95583 c0eac913
Okay now I'm confused. The online tool agrees with me. The official test vectors do not. What the hell is going on? Was the stuff I downloaded not official? Did I use the wrong file? Does AES ECB involve more than just using the raw output of the block cipher? Are the test vectors made for a row-major implementation of AES instead of column major like the specs say?
Where does the difference come from? And also, where can I find a reputable source of test vectors?
I am working on a security-critical tool that uses ECDH to establish shared session keys. I want to reinforce this process by using a PQ-KEM algorithm like Kyber. Right now, I am thinking of achieving this by having two independent key exchanges (one with ECDH keys and one using the PQ-KEM) and then deriving the shared key by passing the two derived secrets through an HKDF. Is this a good approach or am I missing something critical?
Welcome to /r/crypto's weekly community thread!
This thread is a place where people can freely discuss broader topics (but NO cryptocurrency spam, see the sidebar), perhaps even share some memes (but please keep the worst offenses contained to /r/shittycrypto), engage with the community, discuss meta topics regarding the subreddit itself (such as discussing the customs and subreddit rules, etc), etc.
Keep in mind that the standard reddiquette rules still apply, i.e. be friendly and constructive!
So, what's on your mind? Comment below!
Hello,
I am wondering for any information on the security of SHA3 and its sponge function versus older hash functions like MD5, SHA1, SHA2.
What makes it more secure? How heavily studied has it been. The sponge function is still newer than the other constructions but its internal state is quite large.
I am looking for hash functions with good security margins.
BLAKE2 and SHA3 are so far the best looking but is there any reason I should look at SHA2 again because it’s well studied.
I would like to engage in a thorough discussion comparing these hash functions.
This is another installment in a series of monthly recurring cryptography wishlist threads.
The purpose is to let people freely discuss what future developments they like to see in fields related to cryptography, including things like algorithms, cryptanalysis, software and hardware implementations, usable UX, protocols and more.
So start posting what you'd like to see below!
A quiet revolution in secure communication
In a digital world dominated by centralized services—where messages, metadata, and personal data often funnel through corporate servers—CommunisP emerges as a beacon of true privacy and user empowerment. We’re not just another “secure messenger”; we’re a movement dedicated to reshaping how communication works. By blending advanced cryptographic techniques with a decentralized, peer-to-peer (P2P) architecture, CommunisP.com offers unrivaled confidentiality, ensuring your conversations remain exclusively yours.
Imagine someone demanding your chat histories... and you literally have nothing centralized to produce. Many “private” messengers still route every message through their own servers or store them in some buffer. CommunisP instead enables direct, encrypted P2P channels, leaving no archives or metadata in a big corporate database. Even under subpoena, there’s no lingering trove to expose.
These inherent issues underscore the need for a platform that values user rights and freedoms over corporate convenience.
1. Browser-as-Server / Always-On Presence
Rather than forcing you to install Docker containers or rent a VPS, your normal web browser (on a home PC) functions as a 24/7 node:
2. W Ratchet Encryption
CommunisP’s signature security layer merges time-based ephemeral key rotation with per-message ephemeral expansions:
3. Ephemeral Local Logs (Optional)
CommunisP stands for a new age of private communication—where you alone decide what’s stored, who sees it, and how ephemeral it stays.
CommunisP is more than a messenger. It’s a quiet revolution in how we exchange data online. By seamlessly combining:
We deliver a system that’s off-grid, off-limits, and in your hands. No phone numbers, no corporate synergy—just encryption, ephemeral privacy, and your personal freedom.
If you’re ready to transcend old paradigms of data-harvesting and central surveillance, visit CommunisP.com, open a tab, pick a nickname, and step into the next frontier of user-driven, cryptographically robust communication.
I need to buy an HSM for a project (need it for compliance with government regulations) and I am kind of confused. Price range is really wide. I can see used THALES nCipher HSMs on eBay for as low as 300$ and as high as 10,000$, even though modules are similar according to Entrust (now THALES nCipher owner) website.
Anyway. Two questions:
I am planning to deploy EJBCA as the API/FrontEND of the HSM to integrate it with my platforms.
Hi, I'm a dual CS & math major. I've been accepted into a mentorship program of sorts and will have the opportunity to do (likely remote) research on a topic (if I find a PI)
I'm interested in crypto and have studied the standard intro class to cryptography (classical ciphers and public key) (my university doesn't offer it, so I studied by myself). I also have a project on implementing elliptic curve cryptographic systems and algorithms. And will take abstract algebra next semester (few weeks)
I'm wondering what the 'normal' knowledge gap should be and if I have enough prerequisites to start getting involved in cryptography research. Is there even a decent chance any PIs would consider me, considering my lack of background?