If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:9:48

Video transcript

a digital signature is basically the the mathematical mechanism for essentially combining a public sequence of numbers with a with a given digital message in it you can really think of a digital signature in many ways as the electronic analog of a of a physical signature so in a physical signature you'll typically affixed let's say a sequence of characters representing your name or identity to a document okay and this process effectively binds your identity to that document and more so by formulating the characters in your name and maybe some particularly unique or peculiar way that's unique to you the hope is that nobody will be able to forge your name on that document now in a digital signature scheme it turns out you can achieve these kinds of properties mathematically now some of the more well-known digital signature schemes include things like the the RSA digital signature scheme which stands for the Rivest Shamir Adelman scheme there's also a scheme known as a DSS which is the digital signature standard actually and actually if you were to use a scheme like RSA or DSS in my mind it's actually a lot harder to forge these digital signatures than it is to forge a handwritten signature so this particular video I'll try to describe the overall higher-level mechanics if you will of a digital signature scheme but I won't actually go into or describe the the underlying mathematical details of let's see a specific scheme like RSA or DSS at least not in this video so the way that a digital signature scheme works is let's say you have a user I'm going to call her Alice and let's say Alice wants to digitally sign a document in the schema in a digital signature scheme alice is going to first generate two keys and these two keys are known as the as the signing key the signing key which is a private key so I'm going to use red to denote it and we'll abbreviate the signing key as SK and then Alice is also going to generate a separate key known as a verification key now the actual process of coming up with a signing key and the verification key kind of happens concurrently Alice will generate these two keys at the same time and the going to have a mathematical relationship okay but the interesting thing is that you want it to be the case that the verification key is public and the signing key will be private but more so I'm in a digital signature scheme it can be hard to come up with the verification key or rather there should be hard to come up with a signing key rather if you only see the verification key okay now let's let's consider what a digital signature on a message will entail so basically if you have a message and let's call this message m and you wish to digitally sign that message what you're going to basically do is apply a mathematical transformation alice is going to apply a mathematical transformation to the message m and her signing key s Kay okay and the result of that transformation the output of that transformation will be a special sequence of numbers that we call the the signature the signature on the the message M okay now the interesting thing here is that the signature basically is one that is derived from a combination of the message m together with the signing key the private signing give alice and it's going to effectively produce a short i give you a relatively short sequence of numbers as an output okay and in particular digital signature schemes should be designed or they typically are designed so that only the person who possesses the signing key that private signing key is capable of generating this type of an output this type of a signature S sub M on the message M okay now the verification process is kind of analogous to the to the signing process but it involves the public verification key so in the verification process you actually have three different inputs so the first input will be the message that you want to to verify the signature of you also need an addition to the message you need to get as input the the signature on that message what is that S sub M look like and then finally the input the final input to the to the verification scheme will be the the public key the public verification key that belongs to Alice okay and these three inputs are put in and there's a mathematical transformation it's apply to the screen button basically where that mathematical transformation is trying to to ascertain or to check is that the signature that you see corresponding in the message M is one that would have been produced by alice's private signing key and this private signing key turned corresponds to alice's public verification key now what I think is really remarkable is that you can actually carry out this process with just the verification key that you don't actually need the the signing key to validate digital signature you don't even need it inadvertently or indirectly you can do everything you can verify everything with knowledge of only the public verification in the verification procedure basically outputs kind of a yes or no it tells you today should I accept the signature or should I should I reject it okay it's a basic validation procedure and so as you can see the the process of signing effectively will bind this public verification key it binds the public verification key to to Alice am i right because alice is the one who published this verification key told the whole world hey this is my verification key in the system and only I will be able to sign messages that will be considered valid with respect to that verification key okay and because the the message is now being essentially bound to this public key and if you think of the public key as an identifier of sort maybe an identifier for Alice then you can think of digital signing as a process that basically binds an identity to an underlying message and that really gives us in the mathematical sense it gives us the analogue of a traditional handwritten signature okay now I want to make two remarks and anything they're particularly relevant so first of all you'll notice that the transformation that produces the actual digital signature itself okay this transformation right here that produces S sub M this transformation basically takes the message it takes the message as one of its inputs okay and what that means is that the signature is depending on the message if you change the message you'll get a different signature now in this sense a digital signature is actually different from a traditional handwritten signature okay your handwritten signature probably doesn't change or more or less stays the same regardless of what it is you're signing but your digital signature is very sensitive to what you're signing and it will vary depending on what you sign if you send a different message you'll get a different signature as an output okay the second remark I want to make is that digital signatures are often associated with a cryptographic hash function and I've already done a video on photographic hash functions and in fact I mentioned in that video and I'll reiterate here that the first cryptographic hash functions were actually designed specifically with digital signatures in mind is there is there a killer application if you will so in particular what typically happens that before you actually assign an arbitrary message let's you have a huge message that you want to sign before you sign this message you're going to basically apply a cryptographic hash function for that message and you're going to get an output from that function the cryptographic hash function at a shorter output the digest of that cryptographic hash function and then what you're doing it in a signing algorithm is it rather than signing the original message you will first hash it and then sign me the hash of the message you'll sign the resulting digest instead of the original message okay and this two-step paradigm of doing kind of hashing and then signing really ends up simplifying the process of digital signing since you effectively are no longer dealing with an arbitrary length input but instead you're working with a fixed length quantity okay in this hash and sign part I like to be as safe as long as it's hard to find two messages that map to the same output under the application of the hash function in other words you can tumble with with two messages that are different but whose output when the hash function is applied to them or identical okay in other words the hash function as long as it's collision resistant okay it will result in a secure signature scheme with this hash ensign paradigm okay now you can probably think about this for a moment but if you could find let's say two input messages they're distinct and laughter the same output under an application of the hash function that would in fact lead to some bizarre problems because a signature on the first message would then be identical to a signature on the second message since in both cases what you're doing is you're not signing the actual message you're signing the hash or the message so if the hashes are identical you'll end up with the identical signature on two different messages and that could create problems like making it easy for maybe a particular message to be forged under this digital signature approach and that's obviously something you don't want you don't want someone to be able to come up with a signature on a on a different message as a person would be the one that you initially intended to sign okay now what is possible then I just want to make this this clear it's possible to describe digital signatures with a lot more mathematical formalism but I hope what this video really was to give you a flavor if you will without drilling into all the the underlying nuances in mathematics