|
-
Nov 23rd, 2006, 06:54 AM
#1
[RESOLVED] Encryption
Well I know there are millions of ways to encrypt text, but for some reason i like to complicate things and decided to attempt to create one. This is supposed to be encrypted one way only, so there is literally no way to decrypt it back. But I'm not sure if you can decrypt it back... so I'm wondering if i use something like this to encrypt data, would someone be able to convert it back?
Also Randomize(Number) is used to Initializes the random-number generator, but what is the largest number that 'number' could be?
VB Code:
Function Encrypt(MyString As String)
Dim ValArray(255) As Long
Dim RetVal As String
num = Len(MyString)
Randomize (num)
For x = 0 To 255
ValArray(x) = Int(Rnd * 255)
Next
For y = 1 To Len(MyString)
RetVal = RetVal & Chr(ValArray(Asc(Mid(MyString, y, 1))))
Next
Encrypt = RetVal
End Function
Private Sub Command1_Click()
Label1.Caption = Encrypt(Text1.Text)
End Sub
-
Nov 23rd, 2006, 06:57 AM
#2
Re: Encryption
If Rnd or Randomize is used then the string can be decrypted, thats what i heard from a microsoft evangelist at a seminar on encryption...
the suggestion is crypto
Last edited by ganeshmoorthy; Nov 23rd, 2006 at 07:04 AM.
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Nov 23rd, 2006, 07:06 AM
#3
Re: Encryption
So this method would be unsafe to use? Or would it take a long while to crack?
-
Nov 23rd, 2006, 07:14 AM
#4
Re: Encryption
 Originally Posted by Andrew G
So this method would be unsafe to use?
Not really unsafe, I would say Yes. But it can be decrypted...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Nov 23rd, 2006, 07:21 AM
#5
Member
Re: Encryption
If the attacker knows the length of the string he can recreate the array of random numbers but he can't decrypt the text with any programs because it is possible that there are several elements in your array that has the same value. But by looking at the pattern an experienced person can decrypt it manually.
When it comes to Randomize, it don't know the limit but i know it is high. Probably at least a double. It can take floating point seeds as well.
-
Nov 23rd, 2006, 07:31 AM
#6
Re: Encryption
mmm..... I suppose it back to the drawing board then... Thanks
-
Nov 23rd, 2006, 07:47 AM
#7
Re: [RESOLVED] Encryption
-
Nov 23rd, 2006, 08:04 AM
#8
Re: [RESOLVED] Encryption
Ah i missed that. I've only seen his 128, 160 and 256 Bit File Encryption/Decryption with MD5, SHA1. Looks kinda similar to what I've tried but it works . Thanks, i'll come in handy later.
-
Nov 23rd, 2006, 08:49 AM
#9
Re: [RESOLVED] Encryption
I just saw your thread...
If you want to make a one way encryption, why not just use MD5 (or SHA1 or SHA256) Hash ? I have the classes in the High Encryption program you said you looked at it.
Also, back to your algorithm, if you want it one way, you will make it much more difficult to break if you have the result constant, instead of preserving the original length.
Also, it may or may not be decryptable because when you fill the array with random numbers, the random numbers could repeat. For example you could have "A" replaced with random number 10, and "B" with random number 10 again... therefore you won't be able to tell the original if it was replaced with the same number.
But then again, if most replacements are with the same random number, then you could have 2 strings, having the same encryption result.
That's exactly what hashing tries to accomplish (like MD5, SHA1, etc.), the chance that 2 strings have the same result is extremly minimal, in fact, that's where the hashing bits come into place.
For example, for MD5 the chance that 2 strings have the same result is 2^128 = 3.4028236692093846346337460743177e+38 (since MD5 is 128 bit)
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
|