https://xkcd.com/838/

He knows when you’re sleeping, he knows when you’re awake, he’s copied on mail/var/spool/mail/root, so be good for godness sake.

  • Rain World: Slugcat Game@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 days ago

    ohoho, this is pernicious (following the wikipedia article on rsa, to the letter >:), mostly c):

    struct KeyPair generate_RSA_keypair() {
        struct KeyPair keypair;
        bigint p = generate_prime();
        bigint q = generate_prime();
        bigint n = p*q;
        bigint totient = (p-1) * (q-1);
        bigint e = 1;
        while (gcd(e, totient) != 1) {
            e++;
        }
        bigint d = modular_inverse(e, totient);
        keypair.n = n;
        keypair.e = e;
        keypair.d = d;
        return keypair;
    }