last day (16 days later) » 

08:14
26
Q: How great is the risk in publicly sharing part of a private key?

Jamie BullIf two people want to check they have the same (say 256 bit) private key, how great is the risk in sharing the first say 8 chars over a potentially public channel? Can an attacker recover any more information than just those characters, and/or how much faster could an attacker crack the key give...

Each private key should correspond to a public key. Couldn't they just compare public keys instead?
If you really need to do this (which I don't think you do), would a cryptographic hash (SHA-256 ?) provide a better level of information with a lot less security issue ? It's not much that the risk is very high, it depends on the threat, but it's completely unnecessary.
Are you talking about a private key in asymmetric cryptography, like RSA, or are you talking about symmetric keys, like AES (which I kind of guess based on using 256 bits as the example size and talking about sharing the key itself)? The answer differs significantly based on which of those you are talking about.
Revealing a very small (easily brute forced) part of the private key cannot be insecure because if an adversary that sees that part could attack the slightly revealed key, an adversary without that part could enumerate all possible values of that part and carry out the same attack.
If I want to know if someone has the same private key as me, I can just check if I can encrypt a message with his public key and then decrypt it with my private key. Simple, I don't even need the other person, @zakinster's hash-based solution is overkill
08:14
@Solomonoff'sSecret not really. If an attacker can brute force the 248 bit unexposed part of the key in a few days as instance, it would have take the same attacker a few years (feat days times 2^8) to brute force the whole 256 bits. When bruteforcing, for each of the 256 values of the first 8 bit, you still have to check the 2^248 possible values of the 248 remaining bits.
I'm not planning on doing this. It was more thinking about being on a slack channel or similar and to quickly say does the key you have start "g28cj..." and whether that was utterly stupid or just a small risk
@MSalters If the question is about asymmetric encryption private keys, you're completely right and that falls into my "you don't really need to to this" case. I was just covering the other cases, but we may be in front of a XY problem.
@zakinster You're right, revealing part of the key can help the adversary by a certain factor. But it helps by at most that factor. It doesn't lead to a sudden catastrophic loss of security.
@Solomonoff'sSecret yes, and without powerful quantum computing, brute force is currently not a threat with a key of that size, even if revealing half of it. But there may be other attack vectors, specific to the encryption algorithm weaknesses, that may be leveraged by knowing part of the key.
@JamieBull the level of risk depends on the threat model, but it is kind of stupid when you can almost as easily share a hash in a slack channel : "Is the md5/sha-1 hash of you key 098f6... ?". All modern operating systems provide some native hash functions and every IT guy should know how to use them.
@zakinster "But there may be other attack vectors, specific to the encryption algorithm weaknesses, that may be leveraged by knowing part of the key." That is exactly what I'm saying is not possible. Leaking n bits of information can only make it easier by at most a factor of 2^n.
08:14
@Solomonoff'sSecret That's true, but depending on the amount of the information revealed (n bits), the factor 2^n - if high enough, say n > 32 - may transform a "practically impossible" attack scenario to a "technically possible" one, and thus possibly lead to a "sudden catastrophic loss of security".
Or possibly create a signature using both for some well known text, and compare the signature?
Is it a bitcoin private key? If so, don't worry, it is perfectly safe to provide the first 8 bytes. What are they?
If you are using RSA, technically the public key is part of the private key. You can share that part all you want.
It seems people have been giving incorrect answers due to the popularity this question got. You have people talking about how a 4096 bit key has a 2^4096 keyspace, people who are claiming that factoring a large RSA is harder than brute forcing it, and people who don't even understand the basic structure of such a key, thinking it's all homogenous. You should probably go to Crypto.SE if you want actual answers.
Any private key should not be owned by more than one individual. Public key cryptography is designed upon this principle
08:14
Leaking part of a blurry QR code containing the private key of a bitcoin wallet led to the recovery of the complete key. See medium.freecodecamp.org/…
Can a hacker recover information with the first 8 characters? Well, they are 25% closer than they were without those 8 bytes. Would you feel safe sharing the first digit of your 4 digit bank PIN over a public channel?
@usr-local-ΕΨΗΕΛΩΝ I'm assuming you are thus saying that any sort of one to one verification of this principal (eg two people comparing keys) would be equivalent to two people deciding to check if their spleens matched by cutting open their torso: even if they think it's a good idea and are comfortable with the scalpel on the table, it's really something they should not take upon themselves to test.

  last day (16 days later) »