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




Reply With Quote