Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've built a mini-kernel from scratch following some tutorials , and now i want to ensure that when i boot-up my system using a boot-loader i want from this one to hash and verify if it's my real system or an infected one !? using the hash and signature mechanism!!
so please if someone could help me with this it'll be a big pleasure for me ^^ , and thank you in advance!
Ps: the boot-loader is in assembly language and the is in C and a small part with assembly .

What I have tried:

for the moment i just finish with building up the mini-kernel but for the authentication mechanism i didn't start it yet , because i just don't have an idea how to start it!
Posted
Updated 6-Apr-18 6:57am

1 solution

First think about exactly what it is you want to authenticate? Likely it is a file. Common ways to do that are a checksum or CRC. One simple way to do this is to reserve the first four or last four bytes of the file to be the checksum bytes. Then read the file, except for the checksum, and compute the checksum of the file's data. You can then compare that with the value contained in the file to verify it. There are lots of articles here and other places on various checksum and CRC algorithms. You should pick one and adopt it because you might want to authenticate other files later. The checksum doesn't have to be four bytes either. If you decide to use the CRC-16 algorithm it will be a two byte value and CRC-32 will be four bytes. If you use a simple XOR algorithm then it could be a one byte value. That's all up to you to decide.
 
Share this answer
 
Comments
Member 13603741 6-Apr-18 15:52pm    
okay thank you first for this good idea , and i just want to confirm if this CRC algorithm is the same as for the Hash Function !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900