How big is an RSA key in bytes, and which sizes do the standards give?
The size of an RSA key in bytes comes from the modulus. RFC 8017 Section 2 defines k as the length in octets of the RSA modulus n, and that is the unit PKCS #1 uses to size RSA keys and signatures. An RSASSA-PKCS1-v1_5 signature is an octet string of length k (RFC 8017, Section 8.2.1), so a signature is exactly as long as the modulus. A 2048-bit modulus therefore produces signatures of the same byte length, and a larger modulus produces proportionally larger ones. Engineers sizing buffers, certificate fields or SSH key files should read k from the key they actually hold, not from the nominal bit size on the label, because the encoded length of a key file includes the public exponent and ASN.1 or SSH framing around the modulus.
The sources listed on this page give two reference points for the bit sizes themselves. The OpenBSD ssh-keygen manual page, as read on 4 December 2026, says the minimum RSA key size is 1024 bits and the default is 3072 bits (OpenBSD ssh-keygen(1)). That default is a tool setting, not a statement that 3072 bits is required by any standard. The SSH transport specification in RFC 4253 Section 6.6 states no minimum modulus size, so the minimum a given server or client enforces may differ from the one OpenBSD ships. Confirm the sizes your own SSH stack accepts and generates before you write them into policy.
This table covers the modulus length, the public exponent and the encoded public and private key structures that carry them, as they appear in RFC 3447 Appendix C and RFC 4253. The public key is the pair of modulus n and public exponent e (RFC 8017, Section 3.1), and the SSH ssh-rsa blob encodes e and n as mpint values after the string "ssh-rsa". For sizes at specific security strengths, the sibling tables on this page handle elliptic-curve, finite-field Diffie-Hellman and symmetric lengths, so this section does not repeat them. Where a byte count is not given in the sources listed here, check the encoding of your own keys with your library or with ssh-keygen before relying on it.
RSA modulus and public key sizes by key size in bits and octets
This table compares RSA key sizes in terms of the modulus length in octets (k), the public exponent rule and the structure of the ssh-rsa public key blob. Read each row as one key size, with the octet length taken directly from the modulus, which also sets the length of an RSASSA-PKCS1-v1_5 signature. Cells the sources do not fill are left as dashes, so confirm any missing value against your own key files or the standard before relying on it.
| Key size | Modulus length (k, octets) | Public exponent rule | ssh-rsa blob structure |
|---|---|---|---|
| 1024 bits (minimum in OpenBSD ssh-keygen) | Not applicable | Integer between 3 and n minus 1 with GCD(e, lambda(n)) = 1 | "ssh-rsa" string, then mpint e, then mpint n |
| 3072 bits (default in OpenBSD ssh-keygen) | Not applicable | Integer between 3 and n minus 1 with GCD(e, lambda(n)) = 1 | "ssh-rsa" string, then mpint e, then mpint n |
| Other sizes (not listed in the sources) | Not applicable | Same rule applies to any modulus size | RFC 4253 states no minimum modulus size |
| Modulus structure (general) | k is the modulus length in octets, per PKCS #1 Section 2 | Defined in RFC 8017 Section 3.1 for any n that is a product of u odd primes, u at least 2 | Not applicable |
What each RSA size column means and where its figures come from
The column that sizes an RSA key is k, the length in octets of the modulus n. PKCS #1 uses this unit throughout, so when a table gives an RSA key size in bits, the octet figure is the modulus length rounded to whole bytes. The modulus is the product of u distinct odd primes, with u at least 2, and it is the largest value in the public key. The public exponent e is a second integer, and RFC 8017 Section 3.1 requires it to be between 3 and n minus 1 and to satisfy GCD(e, lambda(n)) = 1. Because e is usually small, the modulus dominates the size of the public key. The RSASSA-PKCS1-v1_5 signature is an octet string of length k, so a signature is exactly as long as the modulus (RFC 8017, Section 8.2.1). Engineers sizing signature fields or buffers can take the signature length straight from the modulus length without further calculation.
The encoded key lengths come from the ASN.1 structures in RFC 3447 Appendix C. The RSAPublicKey structure is a SEQUENCE of two INTEGER fields, modulus (n) and publicExponent (e). The RSAPrivateKey structure is longer: it holds version, modulus, publicExponent, privateExponent, prime1, prime2, exponent1, exponent2, coefficient and an optional otherPrimeInfos field. Its DER encoding therefore grows with the primes and exponents, not only with the modulus, so a private key blob is substantially larger than the public key it pairs with. The rsaEncryption object identifier, defined as { pkcs-1 1 } in RFC 3447 Appendix A.2.2, appears in the algorithm identifier that wraps the key in certificates and PKCS #8 files. Confirm the wrapper length against your own encoder output, because the sources listed on this page do not give a total encoded length for any particular key size.
The sources listed on this page do not assign a symmetric strength rating to any RSA modulus size, so the strength column should not be read as published guidance. Do not take a bit count from the modulus and treat it as a rated strength. The OpenBSD ssh-keygen manual page, read on 4 December 2026, gives a minimum RSA key size of 1024 bits and a default of 3072 bits for SSH keys. Those are tool defaults and a floor, not a statement that a size is equivalent to a given symmetric key length. The ssh-rsa public key blob in RFC 4253 Section 6.6 places the exponent and modulus as mpint values and sets no minimum size. For strength ratings, check the NIST or other standards documents your organization follows, and record which document you used next to each size you adopt.
Where a 384-octet RSA modulus changes buffer and packet sizing
For a 3072-bit RSA modulus, the length k is 384 octets, and that single number drives several buffer and packet sizes. The cards below show where k appears in signatures, stored key files and SSH public key blobs, and where the sources set no minimum size at all.
Signature length equals k
An RSASSA-PKCS1-v1_5 signature is an octet string whose length equals k, the modulus length in octets. A modulus of 384 octets therefore yields a 384-octet signature regardless of the hash used. Size fixed-length signature fields, protocol message buffers and token payloads to k, not to the digest length. Confirm the modulus length your system actually generates before fixing any buffer size.
RFC 8017Certificate and key file storage
The RSAPublicKey structure is a SEQUENCE holding two INTEGER fields, the modulus n and the public exponent e, and the RSAPrivateKey structure adds further INTEGER fields for the private exponent and primes. Because the modulus dominates the encoded size, public key and private key files grow with the modulus length. Check storage limits, HSM object sizes and configuration fields that cap key file length before deploying a larger modulus.
RFC 3447 Appendix CSSH ssh-rsa public key blobs
An ssh-rsa public key blob is the string "ssh-rsa" followed by an mpint e and an mpint n. Each mpint is length-prefixed, so the modulus bytes, plus any leading zero byte added for a positive sign, set the blob length. Size authentication buffers, configuration parsing limits and key distribution fields to hold the full blob. Note that the mpint length depends on the encoding of the leading byte.
RFC 4253No minimum modulus in RFC 4253
RFC 4253 Section 6.6 states no minimum modulus size for the ssh-rsa key type. A server or client that accepts the blob format will parse a short modulus without objection from the protocol itself. Set a minimum in local policy, and confirm it against the ssh-keygen documentation for your release, since that page sets its own minimum and default for key generation.
ssh-keygen manualKey generation defaults in ssh-keygen
The OpenBSD ssh-keygen manual page, as read on 4 December 2026, gives 1024 bits as the minimum RSA key size and 3072 bits as the default. Keys generated at the default therefore have a modulus of 384 octets. Treat the minimum as a floor for acceptance, not a target, and check that your deployed ssh-keygen version reports the same values before setting size-based buffer limits.
OpenBSD ssh-keygen(1)RSA key figures by component: public key, private key and signature
An RSA public key is the pair of positive integers modulus n and public exponent e, as defined in Section 3.1 of RFC 8017. The modulus is a product of u distinct odd primes, where u is at least 2. The public exponent e must be an integer from 3 to n minus 1 that satisfies GCD(e, lambda(n)) = 1, where lambda(n) is the Carmichael function of n. In the encoded form, the RSAPublicKey structure in Appendix C of RFC 3447 is a SEQUENCE of two INTEGER values, modulus and publicExponent.
- Modulus n: its length in octets is the unit k used throughout RFC 8017, so the modulus size sets the size of the key.
- Public exponent e: the constraint above applies, and the value is a small odd integer in typical deployments, which the sources do not quantify beyond the constraint itself.
- SEQUENCE encoding: the RSAPublicKey structure carries n and e as INTEGER fields, so encoded length includes ASN.1 tags and lengths.
- SSH encoding: the ssh-rsa public key blob is the string "ssh-rsa" followed by mpint e and mpint n, and RFC 4253 Section 6.6 states no minimum modulus size.
- Algorithm identifier: the rsaEncryption object identifier is defined as { pkcs-1 1 } in Appendix A.2.2 of RFC 3447.
Confirm the modulus length and exponent value that your key generation tool produces, since the RFCs define the constraint but not a fixed size for either value.
The RSAPrivateKey structure in Appendix C of RFC 3447 carries the values needed to perform RSA private-key operations. Its fields are version, modulus, publicExponent, privateExponent, prime1, prime2, exponent1, exponent2, coefficient and an optional otherPrimeInfos. The modulus and public exponent repeat the public key, and the remaining fields are the private parameters that the key holder must protect.
- Version: identifies whether the key uses two primes or the multi-prime form that otherPrimeInfos supports.
- Modulus and publicExponent: these match the public key pair, so the public portion is stored inside the private structure.
- privateExponent: the private exponent d, which is the largest single field in the structure.
- Prime and CRT fields: prime1, prime2, exponent1, exponent2 and coefficient support the Chinese Remainder Theorem form of the private operation.
- otherPrimeInfos: optional, present only when more than two primes form the modulus, as Section 3.1 of RFC 8017 permits.
The structure is an ASN.1 SEQUENCE, so its encoded length depends on the tags, lengths and any optional fields in your file. The sources listed do not give a total byte count for each key size, so measure a key your toolchain generates and confirm the layout in the RFC.
An RSASSA-PKCS1-v1_5 signature is an octet string whose length equals k, the modulus length in octets, according to Section 8.2.1 of RFC 8017. The signature length therefore matches the modulus size for a given key, and it does not depend on the length of the signed message. Certificate and token designs that carry a signature field should allocate space for k octets plus any surrounding structure.
- Fixed length: the signature is exactly k octets, so a 2048-bit modulus and a 3072-bit modulus yield different fixed lengths.
- Message independence: the signature length does not change with the message being signed, which makes the field size predictable.
- Modulus link: because k is set by n, any change to the RSA key size changes the signature field size.
- Encoding around the signature: when a signature sits inside a larger structure, such as a certificate or a token, the surrounding ASN.1 or header bytes add to the total.
For a specific key, compute k from the modulus in your environment and compare it with the field width in your protocol or format. Confirm the signature scheme in use, because RFC 8017 defines more than one.
How RSA key sizes compare with the other classical key tables
RSA sizes are easy to misread when they sit next to other classical tables, so start by checking the unit each table uses. In RFC 8017, the length of an RSA modulus is given as k, the number of octets in n, and that is the unit used to size RSA keys and signatures. The public key itself is the pair of the modulus n and the public exponent e, and an RSASSA-PKCS1-v1_5 signature has the same length in octets as the modulus. When you compare an RSA row with a row from the elliptic-curve or Diffie-Hellman tables, confirm whether the figure is a bit length, an octet length or an encoded length before drawing any conclusion. The sibling tables for elliptic-curve key and point sizes by curve and finite-field Diffie-Hellman group and key sizes use their own units and their own encodings, so the numbers do not line up one for one.
The encoding also changes the size you see on disk and on the wire. The RSAPublicKey structure in RFC 3447 is an ASN.1 SEQUENCE of two INTEGER values, the modulus and the public exponent, while the SSH ssh-rsa public key blob carries the algorithm name followed by mpint values for e and n. An SSH mpint is a different binary representation from the ASN.1 INTEGER, so a key that you measure in an SSH file will not have the same byte count as the same key measured in a DER structure. RFC 4253 Section 6.6 also states no minimum modulus size, so the SSH format itself does not set a floor. For operators auditing key files, the minimum and default sizes are set by the implementation, and the OpenBSD ssh-keygen manual page lists a minimum of 1024 bits and a default of 3072 bits as of the date the sources were read.
Before you put an RSA row next to a sibling row, confirm that the two rows match on algorithm, security strength and encoding. Compare each RSA row against the sibling page for the matching algorithm, not against a neighboring row in a different table, and check the encoding the row describes. Your own environment is the authority on what a deployed key uses, so run the key-generation or inspection command your tooling provides and read the modulus length from the result. The sources listed on this page do not say how an RSA size maps to an elliptic-curve or Diffie-Hellman size at a given strength, so use the strength column of each table as the comparison point and do not infer equivalence from the numbers alone.
Checking an RSA key length against your configuration
This sequence confirms the modulus length your RSA keys actually use, checks that the software and file parsers you depend on handle the full key structure, and confirms the minimum and default sizes for SSH key generation. It ends with a question to each vendor so you have a documented answer for the sizes their product accepts.
Record the modulus length in octets
Start by listing every RSA key in use, including public keys, private keys and certificate keys, and record the modulus length of each in octets. PKCS #1 defines k as the length in octets of the modulus n, and an RSASSA-PKCS1-v1_5 signature has the same length in octets as the modulus, so this single value tells you how large signatures and encrypted values will be. Use your key inventory or the output of your key tooling to read the modulus, and convert from bits to octets by dividing by eight. The step is complete when every key has a recorded octet length and a named owner.
Confirm buffers and parsers accept the full key
Next, check that each buffer, certificate parser, HSM interface and file parser in your stack can hold the largest key you recorded. The RSAPrivateKey structure carries version, modulus, public exponent, private exponent, the two primes, the two CRT exponents, the CRT coefficient and an optional otherPrimeInfos field, so a parser that handles only the public fields or a fixed-size buffer sized for an earlier key length can fail on a private key. Test each component with a key at the largest size you use and record the result. The step is complete when every component has passed a load test at that size, or has a documented limit and an owner for fixing it.
Verify the SSH minimum and default key sizes
For SSH keys, compare your ssh-keygen version against the OpenBSD ssh-keygen manual page, which states a minimum RSA key size of 1024 bits and a default of 3072 bits as read on 4 December 2026. Run ssh-keygen with its version or help option on each build you operate, and confirm the minimum and default that build reports, since builds differ. RFC 4253 states no minimum modulus size for the ssh-rsa blob, so the limit comes from the implementation, not the protocol. The step is complete when the minimum and default for each build are recorded against the version number.
Ask each vendor which RSA sizes they accept
Send each vendor of an RSA-using product a written question asking which RSA modulus lengths the product accepts for key generation, import, signing and certificate issuance, and whether any size is rejected or only warned about. Ask for the answer per product version, since acceptance rules can change between releases. Request the answer in a form you can file, such as a dated document or a support article reference. The step is complete when each vendor has responded in writing or has been logged as outstanding with a follow-up date.
Reconcile the results against your policy
Compare the octet lengths from the first step, the parser results from the second, the SSH minimums and defaults from the third, and the vendor answers from the fourth against the RSA key sizes your policy allows. Mark any key that is larger than a component accepts, any SSH build whose default differs from your standard, and any vendor that rejects a size you use. Assign each gap an owner and a fix. The step is complete when the reconciliation is filed with every mismatch listed and either resolved or carrying an assigned owner.
What these RSA figures do not tell you
The modulus length in this table is a sizing figure, not a verdict on the key. The sources define k as the length in octets of the RSA modulus n, and RFC 8017 uses that length to size RSA keys and signatures. A key of a given size is not thereby safe, compliant or suitable for any particular system. Whether a key size meets a policy depends on that policy, the algorithm in use, the key's age and how it is protected, none of which the sources in this table assess. Before relying on a size, confirm it against your own policy or the requirement of the standard or customer that applies to you, and treat the strength column as a reference point rather than a finding about your deployment.
The sizes here are raw lengths, and what goes on the wire or into a file is usually larger. The RSA public key is a pair of integers, and the RSAPublicKey structure in RFC 3447 Appendix C wraps them in ASN.1 SEQUENCE and INTEGER encodings, which add tags and length fields. The SSH ssh-rsa public key blob adds the string "ssh-rsa" and two mpint fields for e and n. Private key structures such as RSAPrivateKey carry further integers, and an RSA signature is an octet string of the modulus length in octets. When you size a buffer, a field or a bandwidth budget, measure the encoded form your software actually produces, using the encoding defined in the relevant standard, and do not assume the modulus length alone is the figure you will store or send.
The OpenBSD minimum and default are the values this page reports as read on 4 December 2026, from the ssh-keygen(1) manual page: a minimum RSA key size of 1024 bits and a default of 3072 bits. Manual pages change between releases, so check the page for the OpenBSD version you run before treating these numbers as current for your hosts. The RFC 4253 SSH transport specification states no minimum modulus size, so a minimum set by one implementation does not bind another. Recheck each figure against the version and documentation you actually operate, and record the version you checked alongside the value.
RSA key size questions people search
How many bytes is a 3072-bit RSA modulus?
The sources supplied for this page do not give a byte count for a 3072-bit modulus, so check it yourself. The length of an RSA modulus is expressed as k, the length in octets (bytes) of the modulus n, as defined in PKCS #1. To compute k, divide the bit length by 8 and round up to the next whole octet, because the modulus is stored as a whole number of octets. Confirm the result against the modulus in your own key file or against the RFC 8017 definition in RFC 8017, Section 2. The same value k sets the length of an RSASSA-PKCS1-v1_5 signature, which is covered in another question on this page.
What is the minimum RSA key size for ssh-keygen?
The OpenBSD ssh-keygen manual page, as read on 4 December 2026, says the minimum RSA key size is 1024 bits and the default is 3072 bits. The minimum is the lowest size the tool will accept, and the default is what it generates when you do not specify a size. Those two values are set by the tool, not by the SSH protocol, so the figures can change between OpenBSD releases and between other SSH implementations. Check the manual page for the version you run with man ssh-keygen, and confirm the defaults on your own systems before you write them into a policy. For a fixed size, pass the -b option with the bit count you need.
Is there a minimum modulus size for ssh-rsa?
The sources supplied for this page do not give a minimum modulus size for ssh-rsa. RFC 4253, Section 6.6, which defines the ssh-rsa public key format, states that no minimum modulus size is set in that section. The key blob is built from the string "ssh-rsa", followed by an mpint for the public exponent e and an mpint for the modulus n. A minimum set by a particular implementation is a separate matter, so check the documentation of the SSH server and client you run. The ssh-keygen minimum discussed in the previous question is one such implementation-level value.
What length is an RSASSA-PKCS1-v1_5 signature?
An RSASSA-PKCS1-v1_5 signature is an octet string whose length equals k, the length of the modulus in octets. The signature is therefore the same number of bytes as the modulus, whatever the message size. RFC 8017, Section 8.2.1, defines this length. The signature length does not depend on the hash function chosen for the message, so a 3072-bit key produces a signature of k octets, where k is computed from the bit size as described in the first question on this page. Confirm the output length in your own implementation with a test signature, and check RFC 8017 for the exact procedure.
Which ASN.1 structure holds the RSA public key?
The RSAPublicKey structure holds the RSA public key. It is a SEQUENCE of two INTEGER values: the modulus n, followed by the public exponent e. RFC 3447, Appendix C, defines this structure. The RSA algorithm identifier used in certificates and key files is the rsaEncryption object identifier, which RFC 3447, Appendix A.2.2, defines as { pkcs-1 1 }. A certificate wraps the public key in a SubjectPublicKeyInfo with that identifier, so the RSAPublicKey sequence is the inner content. When you inspect a key with an ASN.1 dump tool, look for this two-integer sequence, and check your tool's output against RFC 3447 before relying on it.
Which ASN.1 structure holds the RSA private key?
The RSAPrivateKey structure holds the RSA private key. RFC 3447, Appendix C, lists its fields in order: version, modulus, publicExponent, privateExponent, prime1, prime2, exponent1, exponent2, coefficient and an optional otherPrimeInfos. The first two fields and the public exponent match the public key, and the remaining fields hold the private exponent, the prime factors and the values used for the Chinese Remainder Theorem speed-up. Keep this structure protected, because anyone who obtains it can recover the signing key. Check how your key-management software encodes the key, since some tools wrap this structure in other containers.
Does the public exponent e have a fixed value?
The public exponent is not fixed by the sources supplied for this page, beyond its defined constraints. RFC 8017, Section 3.1, says e is an integer between 3 and n minus 1 that satisfies GCD(e, lambda(n)) = 1. Because the RSAPublicKey structure carries e as a separate INTEGER, the exponent is part of every public key you parse. Check the exponent in the key you run, for example with a key-inspection command in your SSH or TLS toolkit, and confirm the value against the constraints in RFC 8017 rather than assuming a common value.
Where an RSA public key and signature travel in a handshake or key file
The diagram starts with the RSA public key, which is the pair of modulus n and public exponent e, encoded as an RSAPublicKey SEQUENCE of two INTEGERs in RFC 3447 Appendix C, or as the ssh-rsa blob of the string "ssh-rsa" followed by mpint e and mpint n in RFC 4253 Section 6.6. The verifier uses that key to check an RSASSA-PKCS1-v1_5 signature, which is an octet string of length k, equal to the modulus length in octets under RFC 8017 Section 8.2.1. Check that k matches the modulus you expect, and note that the two encodings carry the same key material in different structures.
RSA public key and signature paths in an X.509 key file or an SSH exchange.
How DeployOpen works on this
DeployOpen helps teams work out which RSA modulus, public exponent and encoded key lengths their own systems need, and checks those choices against the software that generates, stores and presents the keys. Each engagement starts from the systems in use, so the sizes in these tables are applied to real key files, certificates and SSH configuration rather than to a generic example.
How we scope
- We list every place RSA keys and certificates appear in your environment, including TLS, SSH, code signing and internal PKI.
- We record which key types, modulus lengths and signature formats each system currently produces or accepts.
- We agree the scope in writing before work starts, so deliverables and timelines are fixed up front.
How we build
- We check each system's key generation settings against the modulus and exponent rules in RFC 8017 and RFC 3447.
- We test how your SSH servers and clients handle the minimum and default RSA key sizes published for ssh-keygen.
- We configure self-hosted platforms in your own infrastructure so key lengths match the sizes you have chosen.
How we hand over
- We deliver a written inventory of each key, its modulus length in octets and bits, and the system it protects.
- We document the configuration changes made, with the commands and config keys used, so your team can repeat them.
- We provide a retest record showing that the deployed key lengths match the documented decisions.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
- We can re-check key lengths when a platform upgrade or a new certificate issuance changes the defaults in use.
- Confirm current RSA size guidance in the RFCs and vendor documentation for the versions you run before relying on any figure here.

