10.07.2015 Views

Implementing the RSA cryptosystem with Maxima CAS - Facultad de ...

Implementing the RSA cryptosystem with Maxima CAS - Facultad de ...

Implementing the RSA cryptosystem with Maxima CAS - Facultad de ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Electronic Journal of Ma<strong>the</strong>matics and Technology, Volume 6, Number 1, ISSN 1933-28233 The <strong>RSA</strong> <strong>cryptosystem</strong>3.1 Caesar cipherThe first documented <strong>cryptosystem</strong> is very simple. It just replaces each letter in <strong>the</strong> plain text <strong>with</strong><strong>the</strong> one sitting three positions down <strong>the</strong> alphabet, for example, we would replace A by D, B by E, andso on (<strong>the</strong> last three letters, X, Y, Z, are replaced by A, B, C, respectively). It seems that this methodwas used by Julius Caesar to send military instructions to his generals.This i<strong>de</strong>a can be translated to numbers, for an easier use. If we replace each letter of <strong>the</strong> alphabetby a natural number (adding <strong>the</strong> space between words character) as ina b c d e f g h i j k l · · · r s t u v w x y z0 1 2 3 4 5 6 7 8 9 10 11 12 · · · 18 19 20 21 22 23 24 25 26<strong>the</strong>n <strong>the</strong> encryption function is simplyf(x) = x + 3 (mod 27),while <strong>the</strong> <strong>de</strong>cryption function is, obviously, <strong>the</strong> inverse:g(x) = f −1 (x) = x − 3 (mod 27).These simple properties make <strong>the</strong> Caesar cipher very easy to use. However, <strong>the</strong>y are also <strong>the</strong> origin ofits weakness. To break a <strong>cryptosystem</strong> means to <strong>de</strong>duce <strong>the</strong> encryption/<strong>de</strong>cryption functions from asample of ciphertext (<strong>the</strong> encrypted message); in this case, <strong>the</strong> method of attack is a simple frequencyanalysis of word repetitions (in English, for instance, <strong>the</strong> most repeated number corresponds to <strong>the</strong>most used letter, <strong>the</strong> e, <strong>the</strong> second is <strong>the</strong> t, and so on).Several schemes were <strong>de</strong>vised to improve <strong>the</strong> Caesar cipher. For instance, one could try morecomplicated bijections, such asf(x) = a · x + b (mod 27),<strong>with</strong> a an integer such that gcd(a, 27) = 1, and a, b ∈ {1, 2, ..., 26}. Ano<strong>the</strong>r possibility consistsin taking groups of contiguous letters, instead of one by one; for example, digraphs (groups of twoletters) or trigraphs (groups of three letters). In this case, an encryption function could have <strong>the</strong> formf(x) = a · x + b (mod m),where a, b ∈ {1, 2, ..., m − 1} and m is a number big enough to allow for <strong>the</strong> enumeration (in aone-to-one and onto manner) of every possible combination of three characters. Both parameters, aand m, are necessary for <strong>the</strong> encryption as well as <strong>the</strong> <strong>de</strong>cryption processes, and are called <strong>the</strong> key of<strong>the</strong> <strong>cryptosystem</strong>.Anyway, <strong>the</strong>se systems are too weak to be used in practice. They can be broken in a number ofways, very easily <strong>with</strong> <strong>the</strong> use of a mo<strong>de</strong>rn computer. We have cited <strong>the</strong>m here just for <strong>the</strong> sake ofillustration of <strong>the</strong> concepts involved.40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!