09.07.2015 Views

An Introduction to some Basic Concepts in IT Security and ...

An Introduction to some Basic Concepts in IT Security and ...

An Introduction to some Basic Concepts in IT Security and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

one much faster than by exhaustive search. So keys must <strong>in</strong> general be muchlarger for public-key authentication than for the secret-key case.Note here a very important difference between public <strong>and</strong> secret-key authentication:<strong>in</strong> the secret-key case, if B receives a message from A <strong>and</strong>accepts it, he is himself conv<strong>in</strong>ced that it came from A, but he will not beable <strong>to</strong> conv<strong>in</strong>ce anyone else: both A <strong>and</strong> B have the secret key, <strong>and</strong> so anyth<strong>in</strong>gB claims <strong>to</strong> have received from A could as well have been generatedby B. This does not happen <strong>in</strong> the public-key case: the value S sk (m) canonly be computed by <strong>some</strong>one who knows sk, <strong>and</strong> so it could only have beenproduced by A. This is why public-key authentication systems are also calleddigitial signature schemes, <strong>and</strong> the value S sk (m) is called A’s signature onmessage m. The property is <strong>some</strong>times called non-repudiationNote that, as for public-key encryption, it is important that the receiveruses the right public key when check<strong>in</strong>g a signature, otherwise he can bemade <strong>to</strong> belive that a message comes from A when this is not the case.6.2 Examples of Digital Signature systemsIt is usually the case that given <strong>some</strong> public-key cryp<strong>to</strong>-system, the underly<strong>in</strong>gtechniques can also be used <strong>to</strong> build public-key signature schemes. Thuswe have an RSA signature scheme, <strong>and</strong> also El-Gamal <strong>and</strong> Elliptic curve signatureschemes. For <strong>in</strong>stance, it is straightforward <strong>to</strong> use RSA with publickey n, e <strong>and</strong> private key n, d <strong>to</strong> generate signatures. For this, we will assumethat the message is a number m <strong>in</strong> [0..n − 1]. The idea is that the signer whois the only one who knows the private key, will do <strong>some</strong>th<strong>in</strong>g <strong>to</strong> the messagethat no one else could have done, namely apply the private-key operation <strong>to</strong>the message. That is, the signature on m is s = m d mod n. It turns outthat the special way e <strong>and</strong> d are chosen will ensure that rais<strong>in</strong>g s <strong>to</strong> power emodulo n wil produce the orig<strong>in</strong>al message, i.e., we haves e mod n = (m d mod n) e mod n = mSo when you receive a pair m, s you can check the signature by verify<strong>in</strong>gwhether s d mod n = m. In general, the signature schemes <strong>in</strong> their basic formmentioned here are the same speed as the correspond<strong>in</strong>g cryp<strong>to</strong>-systems.Thus they are much slower than the MAC algorithms, <strong>and</strong> <strong>to</strong>o slow <strong>to</strong> beapplied <strong>to</strong> really large amounts of data. One po<strong>in</strong>t <strong>to</strong> note, however, is thatfor RSA, if we apply the optimization where we use a small number as e,4


then check<strong>in</strong>g a signature will be much faster than generat<strong>in</strong>g one. This isimportant <strong>in</strong> applications where a signature is generated once, but verifiedmany times.6.3 Problems with digital signatures schemesApart from the performance problem, many digital signature schemes do nothave all the security properties we would like, if we use them <strong>to</strong>o naively. For<strong>in</strong>stance, for basic RSA as we just decribed it, an adversary could choose <strong>some</strong>s, compute m = s e mod n <strong>and</strong> claim that m is a signed message. Indeed,this will look OK, s<strong>in</strong>ce m <strong>and</strong> s precisely relate as they should <strong>in</strong> order fora signature <strong>to</strong> be valid. This is not complete disaster, s<strong>in</strong>ce the adverarycannot control the value of m –most likely m is not mean<strong>in</strong>gful at all– butnevertheless this is an undesirable property.6.4 Hash FunctionsThe solution <strong>to</strong> both the speed <strong>and</strong> security problems is known as cryp<strong>to</strong>graphichash functions. Such a function h should have the follow<strong>in</strong>g properties:• It should be able <strong>to</strong> take a message of any length as <strong>in</strong>put.• It should produce an output of fixed length• It should be fast <strong>to</strong> compute, speed similar <strong>to</strong> the best secret-key systems• It should be a hard computational problem <strong>to</strong> produce a collision: two<strong>in</strong>puts x, y such that x ≠ y but h(x) = h(y). Note that the first twoconditions clearly imply that many such x, y exist. But this is f<strong>in</strong>e, wejust need that it hard <strong>to</strong> f<strong>in</strong>d such pairs.W.r.t. the last condition, one can of course always just try <strong>to</strong> compute h onr<strong>and</strong>om x’s <strong>in</strong> the hope that this will happen <strong>to</strong> produce a collision. If theoutput of h has length k bits, this can be expected <strong>to</strong> succeed after about2 k/2 evaluations of h.We argue <strong>in</strong>formally why this is the case: the reason is the so called“birthday paradox” (which is not actually a paradox, but just a <strong>some</strong>whatsurpris<strong>in</strong>g fact from probability theory). If we choose a r<strong>and</strong>om (long enough)5


<strong>in</strong>clud<strong>in</strong>g the <strong>in</strong>tended recipient’s address, are signed? there is <strong>in</strong> fact a verybig difference. The latter method ensures that the sender always commits<strong>to</strong> the identity of the recipient, the former only does this if the recipientis explicitly mentioned <strong>in</strong> the text of the mail. As a silly –but illustrative–example, suppose Bob is <strong>in</strong> love with Alice <strong>and</strong> sends her a signed mail say<strong>in</strong>g“I love you, will you marry me?”. Then with the former method, anyone canclaim <strong>to</strong> have a signed offer of marriage from Bob!A more subtle problem of this type is the case when a sender encryptsa message <strong>and</strong> then signs the ciphertext. This signature does not committhe sender <strong>to</strong> the pla<strong>in</strong>text message! The simple reason is that anyone caneavesdrop a ciphertext from the net <strong>and</strong> sign it, without know<strong>in</strong>g anyth<strong>in</strong>gabout the pla<strong>in</strong>text.7 More About AuthenticationThe secret-key <strong>and</strong> public-key approach <strong>to</strong> authenticat<strong>in</strong>g messages are actuallynot satisfac<strong>to</strong>ry by themselves <strong>in</strong> all cases. The reason for this is thatif I receive for <strong>in</strong>stance a message m with a digital signature from A, thisonly proves that at <strong>some</strong> po<strong>in</strong>t, A produced this message. It leaves open thepossibility for an adversary <strong>to</strong> take a copy of the signed message <strong>and</strong> sendit <strong>to</strong> me as many times as he wants. This is known as a replay attack. IfA is a bank cus<strong>to</strong>mer, the reciever is a bank, <strong>and</strong> the message is a request<strong>to</strong> transfer money from A’s account <strong>to</strong> <strong>some</strong>one else, the security problemswith replay should be evident.So what we really want <strong>in</strong> practice is often not just <strong>to</strong> protect the <strong>in</strong>tegrityof messages, but <strong>to</strong> have a real authentic channel, that is, we want B <strong>to</strong>receive the exact same sequence of messages that A sends, <strong>and</strong> if this notpossible, we want <strong>to</strong> come as close <strong>to</strong> this as we can. If we do not have physicalcontrol over the communication l<strong>in</strong>e, we cannot prevent an adversary fromphysically block<strong>in</strong>g <strong>some</strong> messages or from reorder<strong>in</strong>g them before they arereceived, but we should at least be able <strong>to</strong> make sure that replayed messagesare filtered out.One trivial way <strong>to</strong> ensure this is have the sender make sure that he neversends exactly the same message twice, for <strong>in</strong>stance by append<strong>in</strong>g a sequencenumber, <strong>and</strong> also add a MAC (computed over both message <strong>and</strong> sequencenumber. Then we can have the receiver s<strong>to</strong>re every message he ever receives(or at least the sequence numbers). This will allow the receiver <strong>to</strong> filter out8


8 Gett<strong>in</strong>g both Confidentiality <strong>and</strong> AuthenticityMany applications require both confidentiality <strong>and</strong> authenticity at the sametime. One may of course use a comb<strong>in</strong>ation of the two types of techniqueswe have seen. But it is worth while <strong>to</strong> warn aga<strong>in</strong>st <strong>some</strong> pitfalls:In the secret-key case, we will want <strong>to</strong> compute MAC’s <strong>and</strong> also encryptmessages. But one must use different <strong>and</strong> <strong>in</strong>dependent keys for the two purposes:there is NO guarantee for security if the same key is used. However,there exists specially eng<strong>in</strong>eered encryption modes that provide both confidentiality<strong>and</strong> authenticity at the same time, us<strong>in</strong>g one key. One such modeis known as OEM.<strong>An</strong>other po<strong>in</strong>t is that if you compute a MAC or a signature on the pla<strong>in</strong>text<strong>and</strong> then encrypt, it is safer <strong>to</strong> encrypt the MAC/signature as well, s<strong>in</strong>ceit may <strong>in</strong> general conta<strong>in</strong> <strong>in</strong>formation on the pla<strong>in</strong>text.9 Summ<strong>in</strong>g upHere follows a taxonomy of examples we have seen, both <strong>in</strong> the confidentiality<strong>and</strong> authenticity sections(leav<strong>in</strong>g out the unconditionally secure methods):ConfidentialityAuthenticitySecret-Key AES, DES, RC4, IDEA CBC-MAC, HMACPublic-Key RSA, El-Gamal, Ell. curves RSA, El-Gamal, Ell. CurvesHash FunctionsRIPEMD-160, SHA-1, MD510

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

Saved successfully!

Ooh no, something went wrong!