[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Encryption code

And encrytion algo that will work on Korean windows and normal english windows.  this means that one should be able to encrypt a string with the range of 1 t 127 and decrypt the same.
0
Akhil
Asked:
Akhil
  • 4
  • 2
  • 2
  • +4
1 Solution
 
VbmasterCommented:
Go to www.planetsourcecode.com and search for encrypt or decrypt, you'll find a lot of sample codes for different encryption/decryption algorithms.
0
 
PerBomanCommented:
This is a very simple coding/uncoding
function.

I you call it twice you will have the
string uncoded again.

It's simple replace any char 'x' whit
a char 'y'.
So it's not a hard crypting-algo but easy to implement.

Private Function XorCoding(ByVal oldS As String) As String
   
    Const codeSign = "7" 'could be any character
    Dim newS As String
    Dim char As String
    Dim i As Integer
   
    newS = oldS
   
    For i = 1 To Len(oldS)
        char = Mid(oldS, i, 1)
        Mid(newS, i, 1) = Chr(Asc(char) Xor Asc(codeSign))
    Next i
    XorCoding = newS
   
End Function
0
 
cvidlerCommented:
I got a VB implementation of RC4 (from the makers of RSA http://www.rsa.com/ ) if you want it - just reply to this and I'll sedn the source - in an easy to use Class module...
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
cvidlerCommented:
Forgot to mention - RC4 will encrypt (very strong too upto 2048 bits) all 256 ASCII/ANSI characters and is blazingly fast upto 1.3Mb/s on a 300Mhz processor! Thats the fastest encryption I've seen done in VB (if you wish to prove me wrong - you can send me your code!)

It appears RC4 will be perfect for you're needs...

PS. You can't get VB source from RSA - I had to convert it from C myself.
0
 
VbmasterCommented:
cvidler: is it any different from the 4 implementations you can find at www.planetsourcecode.com?
0
 
AkhilAuthor Commented:
cvidler:  YOu can mail me the source code.  I already have a Rc4 implentation but i need to customize it so that it will work on a DBCS(Double byte char set) evironmetn.  
0
 
davidreabowCommented:
cvidler:   Please could you mail me the source to RC4 encryption as well as the LZW Compression/Decompression.

Thanks
(davidreabow@hotmail.com)






0
 
Beginner2104Commented:
Perhaps you could take a look on the article on www.vb-online.com about encrypting using several charactersets.
0
 
Beginner2104Commented:
Uops! It is called www.vbonline.com
Feature article: Visual Basic and Encryption (by Chuck Easttom)
0
 
cvidlerCommented:
No - my code is entierly different from that at PSC - it actually works to the RSA RC4 standard - unlike the ones at PSC.

I didn't design it to work with UniCode (DBCS) but a simple conversion at either end (before encryption and after decryption will be all that is needed).

I'll fire up my e-mail prog and start firing off the code to you all...

:)
0
 
cvidlerCommented:
Ahkil - I'll need you're e-mail address...
0
 
AkhilAuthor Commented:
Sorry guys i was not well therefor unable to corrospond.  My email address is maddogmehra@yahoo.com
0
 
dreamvbCommented:
This should work fine

Function EncodeDecode(S As String, Password As String)
 J = Len(Password)
 For I = 1 To Len(S)
 letter = Mid(S, I, 1)
 Mid(S, I, 1) = Chr(Asc(letter) Xor Hex(J))
 Next
 Encode = S
 
End Function


Private Sub Command1_Click()
Text1.Text = Encode(Text1.Text, "Password")

End Sub
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now