SPRUJ17I March 2022 – August 2025 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
Where n is the key size. Since the hash used is SHA-512 and the signature is an ASN.1 sequence containing the OID defining which has was used as well as the hash value, the degenerate RSA must have a value of n greater than the maximum digest size. Typically 4096-bit is chosen.
The following sequence is used to generate degenerate RSA keys:
openssl genrsa –out key.pm 4096openssl rsa –in key.pem –text –noout > key.txtopenssl asn1parse -genconf degenerateKey.txt -out degenerateKey.der openssl rsa –in degenerateKey.der –inform der -text -checkopenssl rsa –in degenerateKey.der –inform der –outform pem -out degenerateKey.pemAn example degenerateKey.txt file is shown.
asn1=SEQUENCE:rsa_key
[rsa_key]
version=INTEGER:0
modulus=INTEGER<copied from key.txt>
pubExp=INTEGER:1
privExp=INTEGER:1
p=INTEGER:<copied from key.txt>
q=INTEGER<copied from key.txt>
e1=INTEGER:1
e2=INTEGER:1
coeff=INTEGER<copied from key.txt>
Note that when copying the multi-byte fields from key.txt it is necessary to remove the colons, concatenate the lines and add a preceding 0x.