Тёмный

Detect Corruption with a Checksum 

Jacob Sorber
Подписаться 165 тыс.
Просмотров 16 тыс.
50% 1

Patreon ➤ / jacobsorber
Courses ➤ jacobsorber.th...
Website ➤ www.jacobsorbe...
---
***
Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
More about me and what I do:
www.jacobsorbe...
people.cs.clem...
persist.cs.clem...
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [ / jacobsorber ]
Source code is also available to Patreon supporters. --- [jsorber-youtub...]

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@f15sim
@f15sim 2 года назад
You might want to cover CRC as well. CRC & checksums are heavily used in serial transfer protocols like XMODEM and ZMODEM.
@LuxFlascH
@LuxFlascH 2 года назад
YModem is awesome for serial transfer between Microcontrollers and/or Raspberrys like you said!! But I would always prefer YModem over Xmodem due to the 1k chunk option and the much higher security (CRC16 instead of CRC8). It's awesome to transfer fwu and files
@f15sim
@f15sim 2 года назад
@@LuxFlascH There was an XMODEM-1K, but it didn't take off.
@Hauketal
@Hauketal 2 года назад
The function printing a buffer should be protected against control characters. Otherwise the state of your terminal may be corrupted too.
@69k_gold
@69k_gold Год назад
Correct. Also he should've printed the string in hex tbh. It just makes more sense in terms of computer networks
@rustycherkas8229
@rustycherkas8229 2 года назад
"You just begin. You do the math. You solve one problem and you solve the next one and then the next. And if you solve enough problems, you get to come home.” ---Mark Watney... Like he was talking to all who attempt to write software...😁
@cleightthejw2202
@cleightthejw2202 2 года назад
@Jacob Hey, is there any reasonable thing you could do to help the volume of your audio? I'm only asking because the audio isn't horrible but it could be 'louder' (my speakers are already maxed). And there are other channels I watch where those guys are much louder on my side but I definitely didnt' change anything. Thank you :)
@jacko314
@jacko314 2 года назад
i think a good follow up would be combining error correction algorithms, which really are only applicable to 4 bit, 16 bit, 64 bit based blocks of data (because ecc uses 2d mapped bit arrays). but often this is used in conjunction with an acceptable error detection algorithm like crc64 and in hardware... but of course can be done in software as well. most computers today contain such hardware, like networking cards, motherboards, memory... ect. the idea is pretty simple mathematically, but demonstrates why sometimes hardware is really superior to software for certain applications... enter fpg and custom chips. i helped integrated a dedup driver for a popular file system and checksums was vital for detecting corrupted/duplicated data. i think another follow up would be how checksums can fail for detecting duplicated data if you apply encryption/compression. also checksums are the basis for maps/hashes as well if implemented correctly... actually hashing/compression/encryptioin/dup detection and more all share a lot of commonality related to checksums as they all effectively randomize a bit stream. compression and encryption probably being the most fascinating.
@jacko314
@jacko314 2 года назад
also on a more theoritical level it would be interesting to talk about why a series of checksums for different messages should not be compressible. it is one of the way new checksum algorithms are tested, especially if they are to be considered by a standards body.
@Marco-yj6gg
@Marco-yj6gg 2 года назад
Too bad it doesn't work on politicians 😁
@forben3523
@forben3523 2 года назад
Can you do a video about "auto&&" and forwarding?
@Or.BenHaim
@Or.BenHaim 2 года назад
Isn't the case change when it bit 6? when you add the to byte 32 or subtract 32
@Scotty-vs4lf
@Scotty-vs4lf Год назад
76543210 - Bits 01000001 - A 01100001 - a yep bit 6 i thought so too, but bit 6 is adding or subtracting 64 not 32
@ramakrishna4092
@ramakrishna4092 2 года назад
Hi Jacob I have been following you from month Today I come across one questions in my interview He asked me why pointers are not used in embedded C I don't have points to say or to explain Can you pls explain why pointers are useful and their disadvantages in Embedded C...
@monochromeart7311
@monochromeart7311 2 года назад
Pointers ARE used in embedded C, it's dynamic memory (free-store) that isn't used in embedded C. The reason dynamic memory isn't used in embedded C, is because the hardware is very limited in memory and performance. Memory allocations can cause fragmentation (a form of memory leaks) and are very slow to do due to their dynamic nature. At most, dynamic memory should only be allocated *once* at the *start* of the program.
@sumitbhosale3401
@sumitbhosale3401 2 года назад
Cool Video. Thanks.
@jeanchristophemahalomba2240
@jeanchristophemahalomba2240 2 года назад
I really like all of the tutorials from this channel, however i have a hard time to understand what the speaker says because it's a bit fast, it's kind from him if he speaks a bit slowly.🙂
@tk36_real
@tk36_real 2 года назад
Aren't overflows undefined behavior?
@Reiqy
@Reiqy 2 года назад
Unsigned overflows are well-defined in C.
@filips7158
@filips7158 2 года назад
Not in C. Truncation occurs silently, you're either aware or it or you're not. Hence the compiler warnings when it detects potential overflow condition at compile time.
@Marco-yj6gg
@Marco-yj6gg 2 года назад
Signed integer overflow is undefined, unsigned integer overflow is defined.
@anon_y_mousse
@anon_y_mousse 2 года назад
You can detect when an overflow or underflow would occur and guard against it, though in practice it's rarely needed. For instance, say you need to multiply two numbers and you can't just use a wider type, you can divide one into INT_MAX or UINT_MAX and test if the result is bigger than the other number. If using signed int's, be careful with negative numbers, and always check for 0 when dividing.
@toastyPredicament
@toastyPredicament Год назад
>had Bluetooth on >Backup incomplete.
@livingcodex9878
@livingcodex9878 2 года назад
おはようございます
@livingcodex9878
@livingcodex9878 2 года назад
Moin
@Arbiteroflife
@Arbiteroflife 2 года назад
I think a cryptographically secure hash would be better I think. It has these problems figured out in that it is preimage image resistant, Second pre-image resistant, and collision resistant. They also value speed of taking the hash. en.wikipedia.org/wiki/Cryptographic_hash_function
@anon_y_mousse
@anon_y_mousse 2 года назад
I would like to see you do a video on CRC's. Explain how they came up with the table they use mathematically. I think you could make it more approachable for newbies and would definitely make for another video to recommend.
@Mnogojazyk
@Mnogojazyk 2 года назад
Dr. Sorber, I appreciate what you’ve shown us, but I’m unclear about how a checksum is used in message transmission, file storage, etc. Would you consider a demonstration of that, please? Showing both ends of the process would be helpful, i.e., preparing the transmission and parsing the transmission upon receipt. Is the checksum appended or prefixed to the message and the entire packet sent? Or is the checksum sent in a separate transmission to mitigate against corruption, for instance? Many thanks for your kind consideration.
@anon_y_mousse
@anon_y_mousse 2 года назад
You could check out Ben Eater's channel, he's got several videos on things like hamming codes and distances, parity errors and even CRC's. Even shows how to implement some of this at a hardware level.
@Mnogojazyk
@Mnogojazyk 2 года назад
@@anon_y_mousse, thanks! I’ll do that!
@Ryan-xq3kl
@Ryan-xq3kl Год назад
checksums are used for verification and lookup tables, you cannot derive the data from the checksum without bruteforce which is unreasonable so in a sense there is one layer towards encryption as well although clearly the encryption could be broken via a lookup table.
@_b7090
@_b7090 Год назад
But how do I know that the checksum isn't corrupted 🤨
@JacobSorber
@JacobSorber Год назад
You don't, but the idea is that it's unlikely that the packet and the checksum will both be corrupted in a way that they still match. The better the checksum the less likely it is.
@gabrielruszala4432
@gabrielruszala4432 Год назад
Amazing video. Thank youuuu
@SlideRSB
@SlideRSB 2 года назад
I loved The Martian. One of my favorite sci-fi novels.
@dwaynestgeorge2558
@dwaynestgeorge2558 Год назад
Thanks
@starc0w
@starc0w 2 года назад
Great stuff! Thx!
@DenisovichDev
@DenisovichDev 2 года назад
Good video as always Jacob
@herrdingenz6295
@herrdingenz6295 2 года назад
nice explanation .. but you should do a follow-up vid about CRC/MD5 etc and how to implement those for security measures.. and since you were taling about sending data around.... why don't you write a networking lib (just some basic client/server communication thing) from scratch? first in C .. you may use libcurl^^ and then the whole thing asynchronously in C++ just to show us how to do it ;)
@JacobSorber
@JacobSorber 2 года назад
Sounds like a good plan. I'll see what I can do. Thanks.
Далее
Sockets and Pipes Look Like Files (Unix/fdopen)
12:45
Is memcpy dangerous?
14:08
Просмотров 23 тыс.
Pulling Back the Curtain on the Heap
21:38
Просмотров 37 тыс.
How does fork work with open files?
13:12
Просмотров 10 тыс.
How to make memory read-only in your C programs.
12:57
10 weird algorithms
9:06
Просмотров 1,2 млн
How to Check Your Pointers at Runtime
14:12
Просмотров 31 тыс.
Making a calculator from scratch - #SoME3
24:25
Просмотров 30 тыс.