Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every body , I wonder if I changed the file bits array or bytes (changing positions or values) would the file be unreadable, dose it mean that the file became an encrypted file?. can any one guide me to articles or books to understand what is a file, how it is represented in the computers os. please any help will be appreciated.
thanks for reading my Question.
Posted

1 solution

"dose it mean that the file became an encrypted file?"
No. It means it becomes a corrupted file.

Encryption is a name for a specific process: transforming information so that it cannot be understood without reversing the process using the key value that was used to transform it. Just messing about with values and positions is very unlikely encrypt a file, it just damages it.

What is a file? A sequence of bits, normally arranged into groups to represent bytes or characters (which may be 6 bit, 7 bit, 8 bit , 16 bit or 32 bit) using some defined encoding mechanism which relates an "A" to the internal form (hexadecimal 41 in ASCII 7 or 8 bit) and so on.

After that, it gets a bit complicated as to what a file actually is. What are you trying to find out?
 
Share this answer
 
Comments
ahmad1987 13-Oct-11 13:44pm    
thank you very much for reading and Answering my question. As you said changing the bits or bytes of a file will definitely corrupt the file, that's exactly what I want, to make the file unreadable only if I get it back to the orginal state using my own program. Actually I'm looking for some ways to make my own Ecryption function. So if I demaged a file i will only be the one who can fix it. thank you again.
OriginalGriff 13-Oct-11 14:13pm    
There are two assumptions there that you need to be very careful of:
1) That if you damage the file, you can undo the damage. This may not be the case!
2) That encryption is just a case of scrambling the file. This is definitely not the case! Modern encryption is very-heavy-duty-math based, generally starting with very large prime factors, and if not something I would attempt to improve upon without several years of brushing up my old university level mathematics!

If you are actually going to use this for a serious purpose (rather than just a coding exercise) then I would strongly suggest that you look at the .NET system.Cryptography namespace as the methods there are tested and both implement and meet international standards for encryption. "Home brew" cryptography can generally be broken in hours, rather than centuries - particularly with C# (or any other .NET languages) where the source code is relatively easy to get directly from the executable.
ahmad1987 13-Oct-11 16:01pm    
you really convinced me about encryption and you'r right about cryptography namespace. but if want to manipulate a file just to add more bytes at the end of the file just to hide some information or some addtional bytes (such as a binder program) I'm still want to know about going throug a file bytes. I'm really thankful

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