Click to See Complete Forum and Search --> : Encrypt
Cimperiali
September 7th, 2001, 04:38 AM
Anybody knows where I can find a crypting function for which is not provided the decrypt function?
(purpouse: encrypt paswords only and match the crypted pwd with the typed in one after the last has been crypted)
Thanks for any help
Cesare
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Cakkie
September 7th, 2001, 04:58 AM
For every encryption, there's a decryption algorytm. It's just how good the algorytm is, that makes the encryption good. You could for instance take a fast (but easy to crack) encryption by simply XOR'ing bits over a number (like say 255, which will just swap aal the bits). This will make the password (or whatever) unreadable with the bare eye, so it should suffice for low risk applications.
strIn = "Cimperiali"
for t = 1 to len(strIn)
strOut = strOut & Chr((255 Xor Asc(mid(strIn, t, 1))))
next t
MsgBox strOut
This code results in something i can't even type. Of course, if you know how the encryption is done, it ain't hard to decode (in this case, simply XOR'ing it back again over 255).
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Cimperiali
September 7th, 2001, 05:34 AM
http://www.freevbcode.com/ShowCode.Asp?ID=972
;-)
See you, and thanks for tip.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Iouri
September 7th, 2001, 07:20 AM
I think you can add to each letter ASCII code a random number and then you won't be able to decrypt it.
Iouri Boutchkine
iouri@hotsheet.com
Cimperiali
September 7th, 2001, 07:55 AM
Yes, but remember: two times submitting same word should give out same result...
However, I think I will use something like what you suggested, after all.
Thanks for answering, Iouri.
'this is something I found out in the Net
private Function EncryptString(strText as string, byval strPwd as string)
Dim i as Integer, j as Integer
Dim strBuff as string
'Encrypt the string
If len(strPwd) then
for i = 1 to len(strText)
j = Asc(mid$(strText, i, 1))
j = j + Asc(mid$(strPwd, (i Mod len(strPwd)) + 1, 1))
strBuff = strBuff & Chr$(j And &HFF)
next i
else
strBuff = strText
End If
EncryptString = strBuff
End Function
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Iouri
September 7th, 2001, 08:58 AM
If you want it to give the same result - means that you have encryption algorithm and it can be decrypted.
The other solution can be to implement the decryption key. Even when the decription algorithm exists and you have the open source code, you cannot decrypt without knowing the key. For example you can encrypt by XORing with the key, which only you will know.
Iouri Boutchkine
iouri@hotsheet.com
John G Duffy
September 7th, 2001, 09:01 AM
There are plenty of examples on Planet-source-code.com.vb for Encryption.
If you are looking for one that CAN'T be decrypted you probably need to talk to the Folks at the Pentagon or the KGB or some such outfit.
http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?txtCriteria=encrypt&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=1&optSort=Alphabetical
John G
Cimperiali
September 7th, 2001, 09:09 AM
You're right. Just a pity I am already out of votes...
Have a nice day, John G.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Cakkie
September 7th, 2001, 09:23 AM
There is only one encryption that cannot be decrypted without the key, and that involves using an encryption key that has an equal size as the text you want to encrypt. So if you want to encrypt a file of 2 megs, you will need a key of 2 megs...
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Cimperiali
September 7th, 2001, 09:25 AM
By now I know - thanks in any case: I appreciate the hints of you all. Now do not expect me to rate you! (;-))
See you on The Net
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Cakkie
September 7th, 2001, 09:39 AM
Rate? Like we do it for the rate, we just do it for the kicks. Besides, knowing you, and it being late afternoon there, you'll probably be out of votes for a couple of hours :)
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.