12.3 THE RSA ENCIPHERMENT AND DECIPHERMENT OF ASCII-PLAINTEXT
RSA enciphers and deciphers integers in
. To encipher data, RSA needs to be extended to encipher n-grams of ASCII characters x = (x(0), x(1), …, x(n−1)). An Internet standard is described in [Linn, 1989]; I describe a slightly modified version, using 7 bits for each ASCII character rather than 8 bits.
The extension replaces ASCII text by a binary sequence, which is segmented into bit-vectors of length N2 − 1 where 2N2 − 1 − 1 ≤ N < 2N2. Each such bit-vector corresponds to an integer k in
to which RSA-exponentiation Ee can be applied. The resulting integer j = Ee(k) in general requires N2 bits in its base-2 representation so that there is an expansion under RSA encipherment.
12.3.1 RSA Encipherment of ASCII Plaintext
E1. Replace each character x(i) of ASCII plaintext x = (x(0), x(1), …, x(n−1)) by the 7-bit binary encoding of its ordinal value in the ASCII character code
(Table 12.1).
E2. Concatenate to form the (0,1)-plaintext z (x(0), x(1), …, x(n−1)) → z = (z0, z1, …, z7n−1).
E3. Assume integers in
require N2 bits in their ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access