Re: randomize encryption ..
- From: "Dave O." <nobody@xxxxxxxxxxx>
- Date: Fri, 11 May 2007 10:00:23 +0100
In addition to what J French said, your decrypt routine does not set the
value of random_stck so it will always be either zero or the last value from
the encrypt routine.
I also don't know if the VB random number generator can be sure to always
produce the same sequence (given the same seed) on every platform and under
every OS. My main concern is the hardware random number generators finding
their way into newer microprocessors which may be more supported by later
OS's.
I have used similar techniques but I use a sequence generator to produce a
set of pseudo-random numbers from a given seed - much like the random
generator but I am in control of the whole thing.
Regards
Dave O.
"angelito tan" <diamond_shoe1234@xxxxxxxxx> wrote in message
news:1178849351.765259.75670@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
this is tough,, and i guess i'm in the right site, i wonder is there
somebdy here can help me about randomize encryption, like for example
i input my name angelito and i press the encrypt so the output would
be a chr(ascii) , and when i re-input my name angelito and encrypt it
the output of chr(ascii) would NOT be the same in the first
chr(ascii) , so everytime i input the name angelito and encrypt it
different chr(ascii) would appear, my problem is how about when i
unload the form or close the program and i have this character >>
"#ÞÑÎÝØïæ" << this one was encrypted .. And when i run the program and
put it on the decrypt box the decrypted output was not the string
angelito .. how about dat??
-- here's my work ...
Option Explicit
Dim random_stck As Integer
Dim i As Integer
Dim Cryptology As Integer
Dim Cypher As String
Dim cd As Integer
Dim crypt1 As Integer
Private Sub cmddecrypt_Click()
D_CRYPT (Text1.Text)
End Sub
Private Sub cmdencrypt_Click()
E_CRYPT (Text1.Text)
End Sub
Private Sub E_CRYPT(Text As String)
random_stck = Int(Rnd * Len(Text))
Cryptology = Asc(Mid(Text, 1, 1)) + random_stck
For i = 1 To Len(Text)
Cryptology = Asc(Mid(Text, i, 1)) + random_stck
Cypher = Cypher & Chr(Cryptology And 255)
Next
Text1.Text = Cypher
Cypher = vbNullString
End Sub
Private Sub D_CRYPT(Text As String)
For i = 1 To Len(Text)
Cryptology = Asc(Mid(Text, i, 1)) - random_stck
Cypher = Cypher & Chr(Cryptology And 255)
Next
Text2.Text = Cypher
Cypher = vbNullString
End Sub
Private Sub Form_Load()
Randomize
End Sub
it's only on the form i didn't put it on any modules ...
.
- References:
- randomize encryption ..
- From: angelito tan
- randomize encryption ..
- Prev by Date: Re: randomize encryption ..
- Next by Date: Re: randomize encryption ..
- Previous by thread: Re: randomize encryption ..
- Next by thread: Re: randomize encryption ..
- Index(es):
Relevant Pages
|