There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

whoisearth ,
@whoisearth@lemmy.ca avatar

I genuinely LOL’d at this thank you OP.

cygnus ,
@cygnus@lemmy.ca avatar

Replying to a 10-year-old tweet is a power move in itself.

slazer2au ,

I wonder if you string together enough words can it be a valid key?

cm0002 ,

I would hope so, sentences and words are some of the most secure passwords/phrases you can use

https://lemmy.world/pictrs/image/71426e32-a0e3-450a-9e84-be198e2b3144.png

bjorney ,

Words are the least secure way to generate a password of a given length because you are limiting your character set to 26, and character N gives you information about the character at position N+1

The most secure way to generate a password is to uniformly pick bytes from the entire character set using a suitable form of entropy

laurelraven ,

That’s only really true if you’re going to be storing the password in a secure vault after randomly generating it; otherwise, it’s terrible because 1) nobody will be able to remember it so they’ll be writing it down, and 2) it’ll be such a pain to type that people will find ways to circumvent it at every possible turn

Pass phrases, even when taken with the idea that it’s a limited character set that follows a semi predictable flow, if you look at it in terms of the number of words possible it actually is decently secure, especially if the words used are random and not meaningful to the user. Even limiting yourself to the 1000 most common words in the English language and using 4 words, that’s one trillion possible combinations without even accounting for modifying capitalisation, adding a symbol or three, including a short number at the end…

And even with that base set, even if a computer could theoretically try all trillion possibilities quickly, it’ll make a ton of noise, get throttled, and likely lock the account out long before it has a chance to try even the tiniest fraction of them

Your way is theoretically more secure, but practically only works for machines or with secure password storage. If it’s something a human needs to remember and type themselves, phrases of random words is much more viable and much more likely to be used in a secure fashion.

bjorney ,

We are talking about RSA though, so there is a fixed character length and it isn’t meant to be remembered because your private key is stored on disk.

Yes the word method is better than a random character password when length is unbounded, but creating secure and memorable passwords is a bit of an oxymoron in today’s date and age - if you are relying on remembering your passwords that likely means you are reusing at least some of them, which is arguably one of the worst things you can do.

user224 ,
@user224@lemmy.sdf.org avatar

You didn’t have to call me out like that.

laurelraven ,

Okay, that’s fair… Not sure how I missed that context but that’s totally on me

Fetus ,

Most of my passwords are based around strings of characters that are comfortable to type, then committing them to muscle memory. There’s a few downsides to this:

  • If I need to log in to something on mobile and don’t have a proper keyboard with me, it’s tough to remember which symbols I’ve used
  • I share some of my logins with friends and family for certain things, if they call and need to re-enter a password, it’s usually impossible to recite it to them over the phone (most of my shared logins have reverted back to proper words and numbers to make it easier for the others)
  • If I lose an arm, I’ll probably have to reset all of my passwords.

But yeah, words alone provide plenty of possibilities. There’s a reason cryptocurrency wallets use them for seed phrases.

possiblylinux127 ,

That’s why you need lots of words. (6) If you combine that with a large word list it gets very secure.

Fillicia ,

The part where this falls flat is that using dictionary words is one of the first step in finding unsecured password. Starting with a character by character brute force might land you on a secure password eventually, but going by dictionary and common string is sure to land you on an unsecured password fast.

possiblylinux127 ,

That’d why words are from the eff long word list and there are 6 words

SatyrSack ,

Even if an attacker knew that your password was exactly four words from a specific list of only 2048 common words, that password would still be more secure than something like Tr0ub4dor&3

www.explainxkcd.com/…/936:_Password_Strength

Fillicia ,

If the attacker search for your password specifically then xkcd themself posted the reason why it wouldn’t really matter

www.explainxkcd.com/wiki/index.php/538:_Security

If you’re doing blind attemps on a large set of users you’ll aim for the least secured password first, dictionary words and known strings.

14th_cylon ,

No, it would not. 2048 to the power of 4 is significantly less than 60 to the power of 11.

[www.wolframalpha.com/input?i2d=true&i=Power2048%…

dohpaz42 ,
@dohpaz42@lemmy.world avatar
hendrik ,

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.

slazer2au ,

Public keys are derived from the private key. The asymmetric part is for communication not generation. Afaik

hendrik , (edited )

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.

kamenlady ,
@kamenlady@lemmy.world avatar

The surprised man in the middle

possiblylinux127 ,

Reddit did it in reverse for Tor

ShortFuse , (edited )

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:


<span style="font-style:italic;color:#969896;">/**
</span><span style="font-style:italic;color:#969896;"> * @see https://datatracker.ietf.org/doc/html/rfc5208#section-5
</span><span style="font-style:italic;color:#969896;"> * @see https://datatracker.ietf.org/doc/html/rfc2313#section-11
</span><span style="font-style:italic;color:#969896;"> * Unwraps PKCS8 Container for internal key (RSA or EC)
</span><span style="font-style:italic;color:#969896;"> * @param {string|Uint8Array} pkcs8
</span><span style="font-style:italic;color:#969896;"> * @param {string} [checkOID]
</span><span style="font-style:italic;color:#969896;"> * @return {Uint8Array} DER
</span><span style="font-style:italic;color:#969896;"> */
</span><span style="font-weight:bold;color:#a71d5d;">export </span><span style="color:#323232;">function privateKeyFromPrivateKeyInformation(pkcs8, checkOID) {
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">der </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">derFromPrivateKeyInformation(pkcs8);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">[
</span><span style="color:#323232;">    [privateKeyInfoType, [
</span><span style="color:#323232;">      [versionType, version],
</span><span style="color:#323232;">      algorithmIdentifierTuple,
</span><span style="color:#323232;">      privateKeyTuple,
</span><span style="color:#323232;">    ]],
</span><span style="color:#323232;">  ] </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">decodeDER(der);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(privateKeyInfoType </span><span style="font-weight:bold;color:#a71d5d;">!== </span><span style="color:#183691;">'SEQUENCE'</span><span style="color:#323232;">) </span><span style="font-weight:bold;color:#a71d5d;">throw new </span><span style="color:#0086b3;">Error</span><span style="color:#323232;">(</span><span style="color:#183691;">'Invalid PKCS8'</span><span style="color:#323232;">);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(versionType </span><span style="font-weight:bold;color:#a71d5d;">!== </span><span style="color:#183691;">'INTEGER'</span><span style="color:#323232;">) </span><span style="font-weight:bold;color:#a71d5d;">throw new </span><span style="color:#0086b3;">Error</span><span style="color:#323232;">(</span><span style="color:#183691;">'Invalid PKCS8'</span><span style="color:#323232;">);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(version </span><span style="font-weight:bold;color:#a71d5d;">!== </span><span style="color:#0086b3;">0</span><span style="color:#323232;">) </span><span style="font-weight:bold;color:#a71d5d;">throw new </span><span style="color:#0086b3;">Error</span><span style="color:#323232;">(</span><span style="color:#183691;">'Unsupported PKCS8 Version'</span><span style="color:#323232;">);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">[algorithmIdentifierType, algorithmIdentifierValues] </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">algorithmIdentifierTuple;
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(algorithmIdentifierType </span><span style="font-weight:bold;color:#a71d5d;">!== </span><span style="color:#183691;">'SEQUENCE'</span><span style="color:#323232;">) </span><span style="font-weight:bold;color:#a71d5d;">throw new </span><span style="color:#0086b3;">Error</span><span style="color:#323232;">(</span><span style="color:#183691;">'Invalid PKCS8'</span><span style="color:#323232;">);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">[privateKeyType, privateKey] </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">privateKeyTuple;
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(privateKeyType </span><span style="font-weight:bold;color:#a71d5d;">!== </span><span style="color:#183691;">'OCTET_STRING'</span><span style="color:#323232;">) </span><span style="font-weight:bold;color:#a71d5d;">throw new </span><span style="color:#0086b3;">Error</span><span style="color:#323232;">(</span><span style="color:#183691;">'Invalid PKCS8'</span><span style="color:#323232;">);
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(checkOID) {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">for </span><span style="color:#323232;">(</span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">[type, value] </span><span style="font-weight:bold;color:#a71d5d;">of </span><span style="color:#323232;">algorithmIdentifierValues) {
</span><span style="color:#323232;">      </span><span style="font-weight:bold;color:#a71d5d;">if </span><span style="color:#323232;">(type </span><span style="font-weight:bold;color:#a71d5d;">=== </span><span style="color:#183691;">'OBJECT_IDENTIFIER' </span><span style="font-weight:bold;color:#a71d5d;">&& </span><span style="color:#323232;">value </span><span style="font-weight:bold;color:#a71d5d;">=== </span><span style="color:#323232;">checkOID) {
</span><span style="color:#323232;">        </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#323232;">privateKey;
</span><span style="color:#323232;">      }
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#0086b3;">null</span><span style="color:#323232;">; </span><span style="font-style:italic;color:#969896;">// Not an error, just doesn't match
</span><span style="color:#323232;">  }
</span><span style="color:#323232;">
</span><span style="color:#323232;">  </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#323232;">privateKey;
</span><span style="color:#323232;">}
</span>

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).

github.com/…/privateKeyInformation.js#L40

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 one is absent in the public key, then anybody reading it could get a kick out of reading your public certificate.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines