Securing Stream Ciphers (HMAC) - Computerphile

Поделиться
HTML-код
  • Опубликовано: 10 фев 2025
  • Bit flipping a stream cipher could help you hit the Jackpot! But not with HMAC. Dr Mike Pound explains.
    Correction : "pseudo" is spelled incorrectly on the graphic.
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscom...
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Комментарии • 229

  • @ZehEduardo
    @ZehEduardo 7 лет назад +427

    I want to meet this man. I feel like I could hear him talking from hours and not get bored.

    • @JoeMarGonzales
      @JoeMarGonzales 5 лет назад +11

      @urbex2007 I guess it's supposed to be that way. He never looks directly into the camera, he looks towards the hidden interviewer instead.

    • @pierluiginegro772
      @pierluiginegro772 3 года назад +11

      It's his enthusiasm that does the trick! I'm absolutely caught up in his speech, unable to stop listening, getting angry at the video ending so abruptly!

    • @misspaula9186
      @misspaula9186 2 года назад

      You can say that again

    • @arrowtlg2646
      @arrowtlg2646 2 года назад +1

      I took the Computer Security Module and audited the Cryptography modules this year at the university of nottingham, both of which were taught by Dr Mike Pound, and honestly it was amazing. He has a great way of explaining hard concepts in a way that's easy to understand.

    • @dalegeddes687
      @dalegeddes687 2 года назад

      I'd love to meet this man too huge respect for Mike pound :)

  • @StreuB1
    @StreuB1 7 лет назад +429

    ....I honestly get the feeling that Dr. Pound is wildly more intelligent that we realize or he portrays and he always seems like he has to hold back just a bit so he doesn't inadvertently say too much. Like, there is a line that shouldn't be crossed with regard to explaining things and he is constantly dancing with that line and at times has to stop for a moment and think "Ok, right, where am I?....oh, right, ok we can go further" lol
    Anyone else get that??
    Hes awesome man.

    • @minihjalte
      @minihjalte 7 лет назад +17

      Brian Streufert what? He is obviously very intelligent, else he wouldnt have doctorate.

    • @StreuB1
      @StreuB1 7 лет назад +9

      Nooo....beyond that level even!

    • @minihjalte
      @minihjalte 7 лет назад +21

      Brian Streufert what level do you mean? Omnipotent/supernatural level?

    • @FriedEgg101
      @FriedEgg101 7 лет назад +44

      Would you say that you find his intelligence artificial?

    • @kale.online
      @kale.online 7 лет назад +9

      I get what you mean. Hopefully like Robert Miles he starts his own channel

  • @markusdemedeiros8513
    @markusdemedeiros8513 7 лет назад +120

    Dr. Pound! This guy could read me his shopping list and I would still watch it

  • @SmallSparrowsChannel
    @SmallSparrowsChannel 6 лет назад +26

    Absolutely love these computerphile videos. To the team: please do not stop making more videos!

  • @gatoradeee
    @gatoradeee 7 лет назад +46

    This bloke is a well-rounded pundit of computer science--vision, cryptography, algorithms, all the good stuff.

  • @OnlyUseMeEquip
    @OnlyUseMeEquip 7 лет назад +14

    make a 2 hour video with this guy, i could listen to him all day

  • @amaarquadri
    @amaarquadri 7 лет назад +4

    The encryption related Computerphile videos are some of my favorite.

  • @jony7779
    @jony7779 7 лет назад +18

    Great video. I love Mike Pound - he is my favorite person on computerphile

  • @Xe4ro
    @Xe4ro 3 года назад

    Switching off is probably not what anyone has ever done that clicked on a Computerphile video, especially with Mike.😁

  • @jamesvanden6251
    @jamesvanden6251 7 лет назад +35

    HE'S BACK! ALL ABOARD THE TRAIN TO POUND TOWN...

  • @CadaverCo
    @CadaverCo 13 дней назад

    God damn I love this channel. Really helping me study for my CISSP when I don't understand some of the more technical questions.

  • @daft_punker
    @daft_punker 7 лет назад +25

    This guy is my favorite!

  • @friewire
    @friewire 7 лет назад

    I have an exam in computer security coming up soon. These videos are golden

  • @kingofshorekishore
    @kingofshorekishore 4 года назад

    its said if you can explain something in simple words, you dont understand the concept. But you sir are just a marvel. Thanks alot.

  • @brooped
    @brooped 7 лет назад +228

    Please sent Mike £100

    • @Anvilshock
      @Anvilshock 7 лет назад +2

      Sneeze bent like 7FFF

    • @kebman
      @kebman 7 лет назад +1

      Thank you Please!

    • @philtrem
      @philtrem 6 лет назад +2

      He wants it yesterday !

    • @8b8b8b
      @8b8b8b 5 лет назад

      Please sent Mike £100 yesterday
      Please send Mike £100 today

    • @downstream0114
      @downstream0114 5 лет назад

      Plase send Mike £10M

  • @DreamingWithEyesWide
    @DreamingWithEyesWide Год назад

    Dr. Mike is the best! And this totally reminds me of the Office, especially with the personal interviewing and the random zooms and close-ups 😂 I also love the washing machine animation!!

  • @bhexric
    @bhexric 7 лет назад

    I didn't even know HMACs existed until I came across them at work - it's good to know a bit more about them.

  • @esmatsaidy
    @esmatsaidy 4 года назад

    I like the way how he comes to the topic, it's brilliant Mike!!!!

  • @dlovegrove11
    @dlovegrove11 7 лет назад

    I feel like these videos always just scratch the surface and don't go in depth too often. I really would like to see some in depth content for the loyal subscribers!

  • @ArthurKhazbs
    @ArthurKhazbs 7 лет назад +19

    Mike is implicitly asking us to send him £100

  • @brandonbirchall5389
    @brandonbirchall5389 7 лет назад +32

    Love this series, but could you please cover Elliptic curve Cryptography? I feel like this channel explains everything the best, so it would be much appreciated.

    • @foobargorch
      @foobargorch 7 лет назад +2

      djb and Tanja Lange have a great intro to the subject from 31c3

    • @cobaltno51
      @cobaltno51 5 лет назад

      @@foobargorch Thanks for that!

  • @lynxtouch
    @lynxtouch 4 года назад

    You're helping me so much studying for my Security+ exam!!!!

  • @abnorcscreenname8489
    @abnorcscreenname8489 7 лет назад

    This guy is awesome. Make sure he keeps on making us videos!

  • @rogervanbommel1086
    @rogervanbommel1086 3 года назад +3

    Well, do not forget AES CBC is weird, it’s a block cipher, though because of the XOR chaining you can also do this there

  • @marcthachxuanky5744
    @marcthachxuanky5744 7 лет назад

    This is the most amazingly clear and concise explanation, thanks

  • @y__h
    @y__h 7 лет назад +9

    Someday you should do a video on AEAD, which is more modern than plain old Stream cipher.

  • @aparnasingh6829
    @aparnasingh6829 4 года назад

    How are you able to explain topics so easily.Seriously, it seems like child's play when I understand things like this

  • @gcheese25
    @gcheese25 3 года назад

    Should have watched this video before my midterm...finally I feel like I know something. Thanks!

  • @00a5-h8j
    @00a5-h8j 7 лет назад +75

    This video seemed to end without much of a conclusion...

  • @КириллРагузин-р9в
    @КириллРагузин-р9в 7 лет назад +2

    The seccond method can actually be just as secure if it is guaranteed that none of the valid messages can be a simple concatenation of 2 or more other valid messages. The easiest way to guarantee it is just to always put a total message length block somewhere inside the protected message. This method is a little bit faster than the HMAC.

  • @boynedmaster
    @boynedmaster 7 лет назад +9

    just had an hmac nightmare, this came a bit too late

  • @pinnekjtt8002
    @pinnekjtt8002 2 года назад

    I freaking love this dude. Why aint this guy my teacher.

  • @yoavklein123
    @yoavklein123 3 года назад +2

    Something I didn't understand. Around 5:00, after introducing the first "naive" solution to the problem of tampering the stream cipher - i.e. computing a hash - Dr. Mike rejects this immediately because the middle-man can easily tamper the message and then compute a hash. what I don't understand is how can he compute the hash of the unencrypted message? All he has is the encrypted message, and if the hash is of the un-encrypted, how can he compute this?

    • @0xbenedikt
      @0xbenedikt 2 года назад +2

      I don’t understand either. Also if you send the hash encrypted too, there would in my mind absolutely be no way to reconstruct it

  • @mouadjadil2958
    @mouadjadil2958 3 года назад

    these guys are legends

  • @tommyboy3164
    @tommyboy3164 4 года назад

    Thanks. Studying for CISSP. I just subscribed!

  • @harshal_bh
    @harshal_bh 5 лет назад

    thanks a lot this helped me in studying hmac for my exams

  • @alloounou6900
    @alloounou6900 2 года назад +3

    Actual HMAC stuff starts at 4:00
    Until then, he's pointing out flaws with substitution in a stream cipher.

  • @jordanwaeles
    @jordanwaeles 7 лет назад +43

    Is it wrong to feel kinda in love with him? I might have completed my studies if he were my teacher.

    • @Xathian
      @Xathian 7 лет назад +18

      He's the archetype for the perfect teacher to engage students in learning. He combines easy grasped examples with technical concepts and makes even very complex subjects easily understandable even to a slightly learned layman.

  • @Destrolll
    @Destrolll 5 лет назад +3

    5:13 But why don't we encrypt the checksum too? In other words be append hash of the message right *before* we do the encryption

    • @0xbenedikt
      @0xbenedikt 2 года назад +1

      I’d love to know the reason too

  • @f3lixhu123
    @f3lixhu123 3 года назад

    Well done ! really enjoyed your video.

  • @TheStevenhull
    @TheStevenhull 3 года назад

    Gotta love the paper he uses with the sprocket holes. Who does that ?!?! LoL

  • @gabrielazevedo6028
    @gabrielazevedo6028 Год назад

    The teaching is awesome and he explains greatly, but i can't help but to notice how every video seems like an episode from The Office

  • @Bloodman42
    @Bloodman42 7 лет назад +1

    I like the void cube and ghost cube on the shelf. :D

    • @johanneszwilling
      @johanneszwilling 7 лет назад +1

      😏 Ghost Cube has finally been solved 🙌

  • @msolomonbush
    @msolomonbush 7 лет назад +2

    I like the videos that Dr. Pound does on cryptography and cryptoanalytics, but it would be nice if he could get into more of how the math works behind the concepts. Not just describe the variables.

  • @Krissini
    @Krissini 6 лет назад

    thank you for that brilliant video!

  • @dd9516
    @dd9516 7 лет назад +3

    I have a big ask. It may take several videos but I should love to see a simple but complete differential cryptanalysis. And a set on linear cryptanalysis. We hear about it all the time but it means very little to most of us. There are many books on it but these are hard to follow, a video would be much easier and better. Thanks! If you do it I shall sent a much bigger 'thank you', capital letters and all!

  • @loudej
    @loudej 7 лет назад +2

    Great video! Can you also do one talking about HMAC-before-encrypt vs encrypt-before-HMAC? encrypt(message)|hmac(key,encrypt(message)) vs encrypt(message|hmac(key,message))

    • @hardikmaru3311
      @hardikmaru3311 3 года назад

      Confidentiality isn't the objective of HMAC, so encrypting the final message doesn't make sense. HMAC provides authentication and integrity

    • @thomasb1337
      @thomasb1337 2 года назад

      @@hardikmaru3311 You would want to encrypt then HMAC the encrypted message. Also known EtA

  • @xBZZZZyt
    @xBZZZZyt 2 года назад

    06:33 would adding length of message (excluding added length) in message prevent append attack?

  • @d1ngo153
    @d1ngo153 2 года назад +1

    idk why but this reminds me of the office

  • @Valery0p5
    @Valery0p5 2 года назад

    You say hases aren't for disks, but I'm pretty sure full disk encryption needs to have something like that...
    I remember hmacs being mentioned in the WiiU external drive encryption scheme...

  • @bohitargep
    @bohitargep 7 лет назад +1

    YAY he finally solved the ghost cube

  • @PvblivsAelivs
    @PvblivsAelivs 7 лет назад

    Someone just flipping bits like that doesn't have the old message or the new message to compute the hashes from. Plus the hash itself is likely to be encrypted.
    Here, it comes down to how much power you think the attacker has. If he can read all your messages and correctly guess all your keys, you're sunk anyway because he can do whatever he wants.

    • @foobargorch
      @foobargorch 7 лет назад

      it's still useful to ensure by construction that the code that reads these messages can't accidentally reveal any information (for example side channel or timing attacks could play into this), or be made to crash given tampered data, naive tamper resistance schemes do not necessarily meet these criteria even if they exclude tampering per se

  • @loadedfries5764
    @loadedfries5764 7 лет назад

    I've really enjoyed these videos that are related to information and security!
    I was wondering though, could you guys could make some videos in the "Essentials" series that cover the basics of those topics?

    • @foobargorch
      @foobargorch 7 лет назад

      Unfortunately it's a broad subject, and modern cryptography (elliptic curves, for example) has really changed a lot of what is considered "essential" compared to a few years ago.
      There are some great courses on youtube, but that's literally tens of hours of material...

  • @blakezonca9865
    @blakezonca9865 7 лет назад +2

    *Sees doc pound*
    *EXTERMINES THAT LIKE BUTTON*

  • @gedeonandrasmusic
    @gedeonandrasmusic 3 года назад

    "We can actually change the amount get sent, which unfortunately is a purely hypothetical example, I don't actually get any money" 😂

  • @Anvilshock
    @Anvilshock 7 лет назад +3

    This guy couldn't look any more mischievous if he wore a black henchman's mask befitting a 70s' Batman episode.

  • @Tomyb15
    @Tomyb15 7 лет назад +1

    From 6:10 to 6:42 I got completely lost. I didn't understand what you were talking about and also couldn't make out some words. Could somebody explain it to me or just point me to the video I missed to understand that?

    • @foobargorch
      @foobargorch 7 лет назад

      The Merkle-Damgard construction is a way of taking what's called a compression function, which has nothing to do with compression like zip files - that takes two blocks of constant length and produces one block of constant length that is a "mix" of the two inputs, and extends it to any message length by splitting the message into blocks, and chaining the blocks together, so you "compress" an initialization vector with the first block, and then take the output of that and the next block and "compress" that...
      Since the final hash is output of the last compression operation, if you know the hash of a message, you can produce the hash of any of its suffixes, even if you don't know the original message.
      Using his example, you could add additional 0s to the amount, instead of changing the most significant digit, even if it was prefixed with a key.
      By adding another hashing step that also depends on the key, you can prevent this kind of tampering, which is known as a length extension attakc.

  • @Mathematicmaster
    @Mathematicmaster 7 лет назад +1

    0:53
    Left upper corner, that ghost cube :D

  • @fandingoORG
    @fandingoORG 7 лет назад +2

    Doc Pound is my jam

  • @songofyesterday
    @songofyesterday 5 лет назад

    Helps me study for CISSP, thanks!

  • @maxijonson
    @maxijonson 4 года назад +1

    DONT QUIT THE VIDEO JUST YET 😂

  • @paulfragemann3333
    @paulfragemann3333 Год назад

    could you hash the message and append the hash before encrypting it and then verifying i after decryption, or are there any security implications that make that a bad idea?

  • @DrKaii
    @DrKaii 7 лет назад +2

    Why do I get the feel that this guy was a car mechanic in a previous life?

  • @mechris13524
    @mechris13524 7 лет назад +20

    I think in the video, we were shown this as a non-working solution: encrypt(message)|hash(encrypt(message))
    Why couldn't you do this: encrypt(message|hash(message))

    • @gryzman
      @gryzman 7 лет назад

      that's essentially what signing is, you take checksum and encrypt it with the private key - and what you get is a signature.

    • @suncrasher4168
      @suncrasher4168 7 лет назад +1

      but both keys are private...

    • @TMaorgmrtrstogamFFDsKMO
      @TMaorgmrtrstogamFFDsKMO 7 лет назад

      Greg Jaskiewicz j

    • @TMaorgmrtrstogamFFDsKMO
      @TMaorgmrtrstogamFFDsKMO 7 лет назад

      Greg Jaskiewicz o

    • @unvergebeneid
      @unvergebeneid 7 лет назад +1

      Christopher Smith, yes, I was definitely missing an explanation for why that is a bad idea!

  • @recklessroges
    @recklessroges 7 лет назад +1

    I was just writing in the middle of writing an RFC6238 TOTP in C++ (because I can't find any that compile in Code::Blocks to run in cmd.exe. Obviously over on Linux its all just works.)

  • @J2963-u3x
    @J2963-u3x 4 года назад +1

    Hash length extension attack video ?

  • @sarainiaangelsong440
    @sarainiaangelsong440 3 года назад

    Wait a sec? So a Block cipher changes multiple bits? so if I changed a single letter/bit, in the message that in turn makes the entire message of letters before and after get altered also??? I know of alot of coding systems but as far as I'm aware I think everything usually is 1 to 1, example if we used Enigma 1 letter in 1 letter out sorta like a substitution! If we Transposition it then the same amount of letters move around, If we playfair it then we still end up with same count of letters, in fact I can't think of any 1 situation where 1 plaintext letter is fully responsible for keeping the entire rest of the message mathematically in tact The only thing I can think of is... if you Take 8 Letters that are 8 Bits long in Ascii and Put the rows of numbers 1 by 1 under until you get like 8x8 thus 64 bits but instead grouping all the 1st bits and making an Ascii character out of then then all the 2nd bits until all 8 is done then substitute that maybe along with a 1 time pad, then I can see how maybe by chance changing 1 Ascii can sometimes Affect many characters, unless I'm not seeing something here? So example lets say A=001 B=010 C=100 R=111and our word was Cab then 100, 001, 010 if stacked could be 100, 001, 010 which doesn't change anything but lets try BAR, 010, 001, 111 we get now, 001, 101, 011 now this is kinda neat because we have new numbers which might be mapped to a question mark or something if this was 8 bit ascii but then math to it could change it yet again. I can't 100% see how a single change normally can affect the outcome of how a message works, but I can see in my example how sometimes hit or miss it can affect the entire message! I will have to look at block ciphers to maybe understand, but for most part from my experience the bulk of codes/encryption almost always is the Plain Text being heavily altered with some steps where if you isolated any letter usually, you get the plaintext of that specific letter! Equally speaking if deleting a letter anywhere or changing a letter anywhere also usually doesn't disturb a message most times in all of it's entirety. However what I can say is... if it is possible where 1 Letter is the only way to crack the code if unchanged and all characters have that exact same property and must be One! Then yes that would be 100% valuable and secure as you can just take that and put that through 1 to 1 ciphers knowing there was a step involved that binds all of them together as a whole as one unit.

  • @user-sc1gd6kd4u
    @user-sc1gd6kd4u 3 года назад

    Is this part of a series? He mentions the SHA video as if I'm supposed to have seen it before, but I can't find an official playlist with computer security related videos från computerphile.

  • @KulasangarGowrisangar
    @KulasangarGowrisangar 7 лет назад

    Does anyone know, what's inner pad and outer pad which he mentions at 8:10?

  • @baatar
    @baatar 6 лет назад

    So, the outerpad and innerpad are just arbitrary constants that are used to derive the two separate keys which are then used to hash the message authentication code?

  • @domenicgilardoni1802
    @domenicgilardoni1802 6 лет назад

    what exactly stops us from doing h(m|k) as opposed to h(k|m)? we don't need to worry about resuming the internal state of the hash function because that would only allow us to append to the key, not the message

  • @naboogom2733
    @naboogom2733 7 лет назад

    need more !!!

  • @JNET_Reloaded
    @JNET_Reloaded 5 лет назад +1

    What about video encryption is this stream cypher?

  • @charan_75
    @charan_75 2 года назад

    How do the sender and receiver get same key? Do they use key exchange protocols?

  • @AbhijitGangoly
    @AbhijitGangoly 4 месяца назад

    If I create a hash of the message and append that to the end of the message and stream cypher the whole bytes stream (message + hash) it will make things harder to change the message.

  • @george-cristianbirzan8643
    @george-cristianbirzan8643 7 лет назад

    Whose videos are referenced in the bit about hamming distance at 8:50, Dave Brelson is the best I can make out...

    • @Computerphile
      @Computerphile  7 лет назад +2

      +George-Cristian Bîrzan Professor Dave Brailsford has done a number of computerphile videos regarding hamming codes

    • @george-cristianbirzan8643
      @george-cristianbirzan8643 7 лет назад

      Right. Thanks! English pronunciation/spelling is weird.
      However, I always felt that guests on the show should be showcased more, nobody reads the description. I'll blame it on that! :-(

  • @darshanv1748
    @darshanv1748 2 года назад

    If we insert the hash (k1|m) at the start of message itself won't it also solve the problem?
    May be it s not efficient to prepend than append but i think it'l also solve the problem, but i would like to know your opinion

  • @HillChris1234
    @HillChris1234 5 лет назад

    It's David Brent!!!

  • @johnbll106
    @johnbll106 4 года назад +1

    So I guess the length extension video never came out sed.

  • @mihaistoian_
    @mihaistoian_ 2 года назад

    Thank you!

  • @TotalImmort7l
    @TotalImmort7l 4 года назад +1

    There is a guy named Please who pleases Mike.
    Anyways, what is special about CMAC and Poly1305?

  • @LucasAbedecain
    @LucasAbedecain 4 года назад

    I've used you guys so often in my degree, can you guys start a Patreon so that myself and others can donate?

  • @oriongalactic
    @oriongalactic 6 лет назад

    Why we just hash before encrypt all together message and hash? we could not compute a new hash for the changed message since we would need to know the encryption key

  • @coomservative
    @coomservative 5 лет назад

    why not just append a salt and signature of the message+salt after that BEFORE applying the cipherstream? The attacker could change the message, but they're going to have a pretty hard time guessing what the salt is to compute the hash and even if they did they wouldn't be able to XOR it to the state the recipient expects.

  • @DanDart
    @DanDart 5 лет назад +1

    The captions on this aren''t great, any way for me to edit?

  • @banderi002
    @banderi002 7 лет назад +3

    You can see at 5:44 the spider bite in Tobey Maguire's hand

  • @fayasamd5204
    @fayasamd5204 4 года назад

    Did i miss something or he never mention how we gonna send the shared secret key to the other person ?

  • @peschebichsu
    @peschebichsu 4 года назад

    There's no video about the length extension attack yet if i see right :(

  • @coding4well
    @coding4well 2 года назад

    I'm a newbie, is hmac reversible?

  • @kolrabi
    @kolrabi 7 лет назад +2

    So... do you HMAC then encrypt or encrypt then HMAC? And for the love of Turing, please clean your screen. :)

    • @stheil
      @stheil 7 лет назад

      IIRC, both are valid approaches and both are used in practice.

    • @bengrap0
      @bengrap0 7 лет назад +8

      Both are used. However, the new consensus is to encrypt then hmac. It allows you to skip decryption when the hmac is invalid. Thus allowing you to break earlier in your algorithm, resulting in less implementation mistakes. For example with block ciphers it might still be possible to exploit a padding oracle if the attacker can distinguish between the decryption failing and the hmac check failing, which in the case of never touching the encrypted text can never happen.

    • @foobargorch
      @foobargorch 7 лет назад

      if you use a random ID, you need to keep track of what it's identifying, which means you need to store that data, and storage scales as the number of things you need to keep track of. Using an authenticated encryption lets you delegate the storage to an untrusted party, without revealing the contents and without compromising your trust in the data, and only need to store a small amount of unchanging data.

  • @iJuenger
    @iJuenger 7 лет назад +1

    CBC mode for block ciphers

  • @jeanmarabou9774
    @jeanmarabou9774 Год назад

    Why not just do SHA2( msg | key ) and not SHA2( key | msg ) like this the malicious appends can only get SHA2( msg | key | malicious ) but the check will be made SHA2( msg | malicious | key) ?

  • @SeeingGreenDevils
    @SeeingGreenDevils 5 лет назад

    so why not just use digital signatures? when would we use HMAC as oppsed to using signtures?

  • @yoavklein123
    @yoavklein123 3 года назад

    The questions of the guy with the camera don't sound very clearly..

  • @macdjord
    @macdjord 4 года назад

    Why not just append the key to the end of the message before taking the hash instead of prepending it to the beginning? Wouldn't that solve length-extension?

  • @DynoosHD
    @DynoosHD 7 лет назад +15

    Why doesnt this work?:
    encrypt(message hash(message))

    • @wapted
      @wapted 7 лет назад

      well, it does work.

    • @gajbooks
      @gajbooks 7 лет назад

      It does, but I think the intent was to secure an arbitrary message without requiring knowledge of what cypher it was using. Other people could bit flip all they want but unless they can decode the stream in the first place they can't correctly re-encode a new hash.

    • @ikkohmation
      @ikkohmation 7 лет назад +4

      It's a stream cipher, so you shouldn't be able to hash the whole message ? (I think)

    • @PeregrineBF
      @PeregrineBF 7 лет назад +9

      It makes you vulnerable to padding oracle and other chosen ciphertext attacks. That construction is called MAC then Encrypt, and is insecure if the encryption scheme is vulnerable to such attacks (many are, and are designed to use a MAC of the ciphertext to remove the vulnerability).

    • @foobargorch
      @foobargorch 7 лет назад +1

      this is worse than MAC-then-encrypt, since the hash isn't signed, a chosen plaintext attack will also allow forgery, for stream ciphers and non chaining block cipher modes:
      You choose m_1, and get c_1:
      c_1 = k_1 ^ (m_1 || H(m_1))
      You can recover the key stream (but not with a chaining block cipher mode):
      k_1 = c_1 ^ (m_1 || H(m_1))
      Forge ciphertext for arbitrary message m_2:
      c_2 = k_1 ^ (m_2 || H(m_2))
      In other words, the hash only provides integrity checking, not authentication

  • @adamurban6904
    @adamurban6904 3 года назад

    What software did you use to make this animation?

  • @Seegalgalguntijak
    @Seegalgalguntijak 7 лет назад +1

    I've seen SHA512 being used as a hash function. Does it have the same flaws as SHA256?

  • @Rsutton99
    @Rsutton99 7 лет назад +1

    Great vid! But, those fingerprints on Mike's monitor are really upsetting :p

  • @nickpelov
    @nickpelov 5 лет назад

    What if instead of appending the key you prepend the key. It's secret so no one would know what the state would be after the key.