The code for the decryptor (unbite.exe), also written in C, is posted HERE. (The encryptor is HERE.)
I had not cleaned up my comments on both source codes, so forgive the unrelated comments.
If you would notice, the original file extension is saved in the encrypted file, but not the original file name. Somehow, that defeats the purpose of having encryption... What the hell...
Also, it's not a good idea to bite .BITE files. For example, if you had a sample.BITE file and you run bite.exe on it, the original .BITE file will be overwritten and running unbite.exe twice would yield bad results. Literally. Try it.
If you have a solution, you are free to modify both the source codes and send me (commenting on this page is recommended) its hyperlink.
Oh, almost forgot: You don't run compiled programs by double-clicking them. You run these programs on a terminal. If you have cmd.exe and you have C:/folder/sample.txt you could either input:
(...)> cd C:/folder/
C:/folder> bite sample.txt
or
(if you have the bite.exe on the current folder you are in)
(...)> bite C:/folder/sample.txt
Output files show up just where the input files are located. You could also add a "/?" switch to view some info. You know what I mean, right?
Linux compatibility is not known. Sorry.
If you had asked why "bite" is the name of my program, that's because it gives each character a "byte" representation, a sequence of eight 1's and 0's. I had also thought an acronym for it:
"Byte Iteration Transcriptor-Encryptor".
"Transcriptor" since it has a 1-to-1 character-byte correspondence, and "Encryptor" since you could use an encryption key.
You could already guess what unbite means.
I had come up with a better encryptor, but I have not started to write it yet. Sembreak madness.
10.27.2009
Simple Encryptor
Hi again, I have written a very simple program that encrypts files (preferably .TXT files).
The code, written in C, is posted HERE.
I have yet to create a decryptor for this program.
When you're very young, have you tried replacing letters or words with another to hide your messages from prying eyes? That's how encryption works. It smartly secures data so that anyone couldn't open or read it without a special privilege.
In my toy program, I just represented each character from the source file with a set of 1's and 0's. That's a very weak encryption, since a single character while just mean one special sequence of data. In some ways, some people (given that they're smart) can still decrypt the output file by paper.
So, think about it: How will an algorithm produce multiple representations for a single string of input data, and at any time, its decryptor can understand that they're the same?
The code, written in C, is posted HERE.
I have yet to create a decryptor for this program.
When you're very young, have you tried replacing letters or words with another to hide your messages from prying eyes? That's how encryption works. It smartly secures data so that anyone couldn't open or read it without a special privilege.
In my toy program, I just represented each character from the source file with a set of 1's and 0's. That's a very weak encryption, since a single character while just mean one special sequence of data. In some ways, some people (given that they're smart) can still decrypt the output file by paper.
So, think about it: How will an algorithm produce multiple representations for a single string of input data, and at any time, its decryptor can understand that they're the same?
8.14.2009
8.03.2009
FREE STUDENT SNIPPETS: TRIVIA
TRIVIA: Function in gets()
Fact: Usually gets(str_name) is given variable names as parameters.
SuperFact: The prototype of gets() is char *gets(char *str) meaning
1. gets() operates on addresses
2. gets() returns the address in str
Given that, code using gets() and an address-returning function is posted HERE.
Be sure to read the program notes and comment! Have fun coding!
:D
Fact: Usually gets(str_name) is given variable names as parameters.
SuperFact: The prototype of gets() is char *gets(char *str) meaning
1. gets() operates on addresses
2. gets() returns the address in str
Given that, code using gets() and an address-returning function is posted HERE.
Be sure to read the program notes and comment! Have fun coding!
:D
7.31.2009
Welcome to KoffeeAddikt's BlogSpot!
Hello, I'm KoffeeAddikt, a UPLB CMSC student.
I'm opening up this blogspot so that some of my friends can view some of the C and Java codes I wrote, and also discuss some programming concepts.
The snippets that I will put are KopyLeft-ed, but of course, I am free to take them off the net.
I can also put in here some random thoughts that viewers can either ignore or think about (hopefully) and reply.
Thanks for visiting and have a good time reading!
I'm opening up this blogspot so that some of my friends can view some of the C and Java codes I wrote, and also discuss some programming concepts.
The snippets that I will put are KopyLeft-ed, but of course, I am free to take them off the net.
I can also put in here some random thoughts that viewers can either ignore or think about (hopefully) and reply.
Thanks for visiting and have a good time reading!
Subscribe to:
Posts (Atom)
