PDA

View Full Version : ????



Tek-E
February 10th, 2009, 09:37 PM
I think someone should start another programming challenge.

PythonPower
February 10th, 2009, 09:48 PM
Yeah; definitely! :P

Who's gonna volunteer?

run1206
February 10th, 2009, 09:49 PM
what language?

PythonPower
February 10th, 2009, 09:52 PM
Any. We are neutral. :)

OK, I'll volunteer... Still, if anyone else wants to set the problem, there more than welcome. ;)

Tek-E
February 10th, 2009, 09:53 PM
Im up for any language!
just no assembly!!! :( ughhhhh. lol.

matmatmat
February 10th, 2009, 09:57 PM
Here's one, make a program to encrypt & decrypt a file using a key in any language - but the code has to be as reusable as possible.

PythonPower
February 10th, 2009, 09:59 PM
That may be too open ended... But go for it! :)

Tek-E
February 10th, 2009, 10:01 PM
I dig this challange, can we create our own key or does it have to be an existing key?

matmatmat
February 10th, 2009, 10:06 PM
How about a user-specified key? Is it true they use prime numbers?

Tek-E
February 10th, 2009, 10:10 PM
How about a user-specified key? Is it true they use prime numbers?
A user specified key would be interesting yes. They use prime numbers mostly im sure.

Tek-E
February 10th, 2009, 10:14 PM
lol. When I get home from school today Ill post on old shell script I wrote a long time ago that I used to use as a means to encrypt my files. You guys have to promise not to laugh though!!! :)

snova
February 10th, 2009, 11:28 PM
How about a user-specified key?

It would be a bit pointless if you couldn't change the key...


Is it true they use prime numbers?

That would be Public Key Cryptography- which gets rather complicated. I suggest sticking with symmetric keys for this challenge.

Tek-E
February 11th, 2009, 05:51 AM
So I said I would post this script I wrote a long time ago just for giggles. This isnt what I am submitting for this programming challange but I just thought I would share it with people since this challange deals with encryption. Please dont make fun of me too much. Constructive criticism is welcome....but please be nice....I wrote it a long time ago.


#!/bin/bash
f_enc()
{
printf "\n[ Encrypting File ]\n"
cat $_f_name | tr abcdefghij 1234567890 > $_spath$_f_ex
mkdir ENC_PROCESS
mv $_spath$_f_ex ENC_PROCESS
cp ENC_PROCESS/$_f_ex $_spath$_f_ex
rm ENC_PROCESS/$_f_ex
cat $_spath$_f_ex | tr mnbvcxz 5943261 > ENC_PROCESS/$_f_ex
rm $_spath$_f_ex
cp ENC_PROCESS/$_f_ex $_spath$_f_ex
rm ENC_PROCESS/$_f_ex
cat $_spath$_f_ex | tr ovetyasdbn 1029384756 > ENC_PROCESS/$_f_ex
cp ENC_PROCESS/$_f_ex $_spath$_f_ex
rm ENC_PROCESS/$_f_ex
rmdir ENC_PROCESS
rm $_f_name
printf "\n[ Done Encrypting File ]\n"
}
f_enc_setup()
{
clear
printf "File Encryption Utility:\n"
printf "\nSetup:\n"
printf "File To Encrypt: "
read _f_name
printf "Save To : "
read _spath
printf "FileName ( W EX:) : "
read _f_ex
sleep 3
printf "Origional File Will Be Deleted For Safety....."
f_enc
}
sleep 3
f_enc_setup
exit 0


Ughhh just re-reading all of that is horrifying now lol. All it does is "encrypt" text files. I dont know if this actually could be classified as encryption but it makes the text file unreadable so it worked for me at the time. Only problem is.....I never wrote a script to un-encrypt my text files.....I imagine I could do it by working the opposite way that this script did. :/ But yeah....I Think im going to re-write this one...There are alot of things I plan to do different with it lol. Well. Anyways just thought I would throw this out there for your guys's amusement......NO FLAMES lol :)

Tony Flury
February 11th, 2009, 12:26 PM
So you wrote a one-way non-reversible encryption system - can i ask why ?

Why not just delete the files and be done with it ? After all once encrypted they can't be read by anyone (not even you) so they are as good as deleted.

Just very very puzzled.

tneva82
February 11th, 2009, 12:50 PM
That would be Public Key Cryptography- which gets rather complicated. I suggest sticking with symmetric keys for this challenge.

Nah. Did PGC for not one but three different algorithms once. Wasn't THAT hard. Atleast if speed isn't issue ;-)

tneva82
February 11th, 2009, 12:52 PM
So you wrote a one-way non-reversible encryption system - can i ask why ?

Why not just delete the files and be done with it ? After all once encrypted they can't be read by anyone (not even you) so they are as good as deleted.

Just very very puzzled.

Well deleting files does not really delete files. You need bit more than rm textfile.txt to get rid of it. Maybe this increases the level of deletion ;-)

maximinus_uk
February 11th, 2009, 01:58 PM
Just added a new challenge for you all - take a look!

http://ubuntuforums.org/showthread.php?t=1066753

Tek-E
February 11th, 2009, 06:17 PM
So you wrote a one-way non-reversible encryption system - can i ask why ?

Why not just delete the files and be done with it ? After all once encrypted they can't be read by anyone (not even you) so they are as good as deleted.

Just very very puzzled.

You know.....Im not entirely sure why...Thats a darn good question lol :)

....... :/

Tek-E
February 11th, 2009, 06:21 PM
So you wrote a one-way non-reversible encryption system - can i ask why ?

Why not just delete the files and be done with it ? After all once encrypted they can't be read by anyone (not even you) so they are as good as deleted.

Just very very puzzled.

lol. Its one way right now...But it can be reversed...All you would have to do is follow the encrpytion process but work backwards. Its only one-way right now. I started it but just never finished it. It was supposed to be reversable.

snova
February 11th, 2009, 10:39 PM
So you wrote a one-way non-reversible encryption system - can i ask why ?

That's actually quite useful; they're called Hash Functions, One-way Functions, etc. They are designed to "crunch" a file to a very short number, where if you change even one bit of the source text the result is almost completely different.

They're widely used, because they essentially give you an alternate (shorter!) representation of a file. Useful for, say, integrity checks on large ISO's...

jimi_hendrix
February 11th, 2009, 10:42 PM
can we make a new thread for whatever challange we pick?

Tony Flury
February 17th, 2009, 11:30 AM
That's actually quite useful; they're called Hash Functions, One-way Functions, etc. They are designed to "crunch" a file to a very short number, where if you change even one bit of the source text the result is almost completely different.

They're widely used, because they essentially give you an alternate (shorter!) representation of a file. Useful for, say, integrity checks on large ISO's...

Completely agree - but what Tek-E provided did not produce a Hash - it produced an encrypted version of the file.

A Hash is often much shorter - and two files could produce the same Hash. You can't use the hash you uniquely regenerate the source file (Tek-E said he intended the encryption to be reversible just never got round to it), and if you do find two sources with the same Hash are probably very different (meaning that a smaller error in one source will not produce the same Hash - allowing you to use the Hash value as an error check).