|
-
Jul 4th, 2008, 02:59 PM
#1
Thread Starter
Fanatic Member
my encryption algorithm. But is it secure?
I have devised an encryption algorithm, basically it goes like this:
The key is taken and SHA-1 hashed. this creates a 40 key long string.
this string is stored in an array with one character in each variable of the array. the first 40 characters of the message are stored in another array by the same method. each character in each variable of the array which was th e key is converted into it's ascii number using key(i) = asc(key(i)) and this is done to the first 40 text characters too.
the first character of the text and the first character of the hashed key are taken and their ascii numbers are added to get the ascii number of the first character of the encrypted text, this is similar to a one time pad. to prevent overflowing, the number goes back round to 0 if it gets above 255. e.g. 250 + 23 = 18. to decrypt you simply take away the key from the text.
this is done with the second character and the third and so on until the 40th, and then we have no more key characters left. so what we do is SHA-1 hash the key again! so basically we are SHA-1 hashing the SHA-1 hash of the key
and then we use the new 40 characters it gives us. when it gets to 80 we then SHA-1 hash the key again, so we are SHA-1 hashing the SHA-1 hash of the SHA-1 hash of the key and repeat this until we get to the end of the message.
I'm wondering whether this is secure though because we are basically using the same key over and over but just SHA-1 hashing it every time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|