Re: OpenSSL: rsa_builtin_keygen: key size too small
Henry Baker <[email protected]> Wed, 25 Dec 2019 05:51:21 -0800
| Newsgroups | gmane.comp.encryption.general |
|---|---|
| Message-ID | <[email protected]> |
At 09:30 PM 12/22/2019, Henry Baker wrote: >At 06:05 PM 12/22/2019, Matt Palmer wrote: >>On Sun, Dec 22, 2019 at 09:33:40AM -0800, Henry Baker wrote: >>> I tried to downgrade the encryption just for the development phase, >>> but OpenSSL won't allow me to use keys smaller than 512 bits. >>> >>> Does anyone know how to turn off this error message in order to >>> work with much smaller keys? >> >>Based on a quick grovel through the openssl source, it looks like this limit >>is hard-coded, and requires a rebuild of openssl to set the value smaller. >> >>- Matt > >Thanks Matt, Richard, Viktor. > >I've compiled OpenSSL before -- it isn't very difficult -- so I guess I'll have to do it again! > >Re embedded processor: > >Actually, no, it's the other way around. The eventual target (if it ever happens) will likely be a lot *more* powerful than my development machine, so I wanted to play with a "toy" version of the software at some reasonable speed prior to increasing the bit-length of the keys. I gave up and learned how to make my own keys. Here's a toy example (perhaps you need a certificate for your 6502-based Apple ][ web server, secure from Intel 4004-based Eve ?) foo@bar:~ $ cat smallkey.pem -----BEGIN PRIVATE KEY----- MDICAQAwDQYJKoZIhvcNAQEBBQAEHjAcAgEAAgIAuwIBBwIBFwIBEQIBCwIBBwIB AwIBDg== -----END PRIVATE KEY----- foo@bar:~ $ cat smallkey.pem | openssl pkey -text -noout RSA Private-Key: (8 bit, 2 primes) modulus: 187 (0xbb) publicExponent: 7 (0x7) privateExponent: 23 (0x17) prime1: 17 (0x11) prime2: 11 (0xb) exponent1: 7 (0x7) exponent2: 3 (0x3) coefficient: 14 (0xe) foo@bar:~ $ xxd digest.bin 00000000: 0a . foo@bar:~ $ openssl rsautl -sign -in digest.bin -out signature.bin -inkey smallkey.pem -raw foo@bar:~ $ xxd signature.bin 00000000: af . foo@bar:~ $ _______________________________________________ The cryptography mailing list [email protected] https://www.metzdowd.com/mailman/listinfo/cryptography