- cross-posted to:
- linux_memes@programming.dev
- cross-posted to:
- linux_memes@programming.dev
Replying to a 10-year-old tweet is a power move in itself.
this is gold yet I don’t know anyone who would get it that I can share it with
I just shared it with a bunch of people while also telling them that I didn’t care if they didn’t get it and I wasn’t going to explain it.
They’re used to this.
Edit: 2 of them got it. That’s pretty good for me. I’ve played to smaller crowds.
That’s why we come to the internet. Real life people suck.
I have exactly one person and they loved it.
I shared it to the memes group at work, as a developer
That’s why I have a sister studying cyber sec 😎
If you had to explain it, how would you?
I wonder if you string together enough words can it be a valid key?
Yeah, except for the first few bytes. PKCS8 has some initial header information, but most of it is the OCTET_STRING of the private key itself.
The PEM (human “readable”) version is Base64, so you can craft up a string and make that your key. DER is that converted to binary again:
/** * @see https://datatracker.ietf.org/doc/html/rfc5208#section-5 * @see https://datatracker.ietf.org/doc/html/rfc2313#section-11 * Unwraps PKCS8 Container for internal key (RSA or EC) * @param {string|Uint8Array} pkcs8 * @param {string} [checkOID] * @return {Uint8Array} DER */ export function privateKeyFromPrivateKeyInformation(pkcs8, checkOID) { const der = derFromPrivateKeyInformation(pkcs8); const [ [privateKeyInfoType, [ [versionType, version], algorithmIdentifierTuple, privateKeyTuple, ]], ] = decodeDER(der); if (privateKeyInfoType !== 'SEQUENCE') throw new Error('Invalid PKCS8'); if (versionType !== 'INTEGER') throw new Error('Invalid PKCS8'); if (version !== 0) throw new Error('Unsupported PKCS8 Version'); const [algorithmIdentifierType, algorithmIdentifierValues] = algorithmIdentifierTuple; if (algorithmIdentifierType !== 'SEQUENCE') throw new Error('Invalid PKCS8'); const [privateKeyType, privateKey] = privateKeyTuple; if (privateKeyType !== 'OCTET_STRING') throw new Error('Invalid PKCS8'); if (checkOID) { for (const [type, value] of algorithmIdentifierValues) { if (type === 'OBJECT_IDENTIFIER' && value === checkOID) { return privateKey; } } return null; // Not an error, just doesn't match } return privateKey; }
I wrote a “plain English” library in Javascript to demystify all the magic of Let’s Encrypt, ACME, and all those certificates. (Also to spin up my own certs in NodeJS/Chrome).
Edit: To be specific, PKCS8 is usually a PKCS1 (RSA) key with some wrapping to identify it (the OID). The integers (BigInts) you pick for RSA would have to line up in some way, but I would think it’s doable. At worst there is maybe a character or two of garbage at the breakpoints for the RSA integers. And if you account for which ones are absent in the public key, then anybody reading it could get a kick out of reading your public certificate.
It’s assymetric crypto. You’d need to find a matching public key. Or it’s just some useless characters. I suppose that’s impossible, or what we call that… Like take a few billion years to compute. But I’m not an expert on RSA.
Public keys are derived from the private key. The asymmetric part is for communication not generation. Afaik
I’m pretty sure the cryptographic parameters to generate a public key are included in the private key file. So while you can generate the other file from that file, it’s not only the private part in it but also some extra information and you can’t really change the characters in the private key part. Also not an expert here. I’m fairly certain that it can’t happen the other way round, or you could impersonate someone and do all kinds of MITM attacks… In this case I’ve tried it this way, changed characters and openssh-keygen complains and can’t generate anything anymore.
The surprised man in the middle
Reddit did it in reverse for Tor
It the length not the content for the most part. Some keys have syntax such as leading or trailing characters.
I genuinely LOL’d at this thank you OP.
It’s sad that I can’t find anyone to share this with.
I’m in your exact camp.
I share these with friends who might not get it. It’s like a UDP joke
ACK
NAK
␆
As long as you gave your best effort.
I have literally one friend who would get this, and I try not to bombard him with memes, as I can tell it gets on his nerves sometimes, even when he thinks it’s funny.
Burst a kidney please help
While the joke is funny, what is the context? Why did she post the original tweet in the first place?
It’s lady gaga.
If you’ve followed her at all, even indirectly, this is NOT the weirdest thing she’s done, and bluntly, the weirder stuff wasn’t justified (to the public at least).
I’m not trying to throw shade at Gaga at all. Lady, let your freak flag fly all day long. You don’t need my permission to do it, but if you want it, you got it. Weird isn’t bad, it’s just weird.
IMO, at this point, gaga doesn’t need a reason to be weird.
I don’t follow her at all so thanks for the explanation!
I would not have thought that she knows what a private key is 🙉 humans and their prejudices…
Ohhh, it is the other way around, gaga‘s tweet is older
lol