April 27, 2024, 10:00:28 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


File Encryption/Decryption

Started by danbaron, October 08, 2009, 12:23:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

danbaron

October 08, 2009, 12:23:46 AM Last Edit: October 08, 2009, 12:30:02 AM by danbaron
Hi Gang!

Here is an EB console program that will encrypt any type of file, and
will decrypt any file that it has encrypted.

The program does not alter the original file. Instead, it writes another
file, which is the encrypted or decrypted version of the original.

For instance, if the file to be encrypted is called, "ROCKET.ZZZ", then
the encrypted version would be called "ROCKET.ZZZ.E" (the program adds
the suffix, ".E", to indicate that "ROCKET.ZZZ.E", is the encrypted
version of "ROCKET.ZZZ").

When the program decrypts a file, it adds the suffix, ".D", to the file
to be decrypted. So, if "ROCKET.ZZZ.E" was decrypted, the resulting file
would be called, "ROCKET.ZZZ.E.D".

So, after "ROCKET.ZZZ" was encrypted, and then decrypted, two additional
files would exist, "ROCKET.ZZZ.E", and, "ROCKET.ZZZ.E.D".

The suffixes, ".E", and ".D", are added to the original file's name, to
differentiate the three files. However, the program does not care what
the file's extension is. For instance, if you changed the name of
"ROCKET.ZZZ.E", to "MOON", the program would still decrypt "MOON", and
call the decrypted file, "MOON.D".

If you examined the contents of "ROCKET.ZZZ.E", you (hopefully) would
find that it in no way resembled the contents of "ROCKET.ZZZ". However,
the contents of "ROCKET.ZZZ.E.D", and "ROCKET.ZZZ", should be identical.

All you need to do to try the program, is to compile it (as type
"Console EXE"), and run it.

When you run it, it will ask you for three items of information; a pass
code string, an input file, and whether the file is to be encrypted or
decrypted.

In order to decrypt a file, the pass code string with which it was
encrypted, is required.

Within the program code, there are two constants whose values can be
changed. These constants alter the encryption process. (But, in my
opinion, the encryption works OK with the values as they are now set.)
Of course, if you do change one or both of the values, then you will
have to re-compile the program.

At the beginning of the program listing, there is more information
concerning the program operation. There is also an explanation of what
(explicitly) the program does, and how it works. And there are
miscellaneous notes about the program.

Nuf sed.

DTB.
"You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump."  -  W.C. Fields

Haim


pistol350

Tested and I like it too.
Thanks for sharing!
Regards,

Peter B.

danbaron


No problem man, no problem.
You dig, daddy-o?

Cool Cat.  8)
"You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump."  -  W.C. Fields

exjoburger

Thanks for sharing this well-commented program.

ZeroDog


danbaron

I guess I violated protocol.
Larry moved the poem to my comment in "2009 Halloween Challenge". :'(
So, now there are two poems there.
Oh, cruel world!
Oh, cruel, cruel world!! :'( :'(

Anyway, here is what remains of my way of thanking you for your nice words about the program.

Pretty neat,
pretty neat.
Pretty good,
pretty good.
Alright!

Dan.
"You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump."  -  W.C. Fields

ZeroDog

QuoteI guess I violated protocol.
Larry moved the poem to my comment in "2009 Halloween Challenge". Cry
So, now there are two poems there.

<sarcasm>
Of course he did... because thats where birthday and christmas poems belong... in the 2009 Halloween Coding Challenge thread...  ::)
</sarcasm>

danbaron

October 15, 2009, 04:20:26 PM #8 Last Edit: October 16, 2009, 12:39:53 AM by danbaron
Quote<sarcasm>
Of course he did... because thats where birthday and christmas poems belong... in the 2009 Halloween Coding Challenge thread...
</sarcasm>

I dig!
Now, we're on the same wavelength!!

----------------------------------------------------------------

Update:

Larry fixed everything.
"You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump."  -  W.C. Fields