MLH wrote:
Gotcha. Thx very much. I like polite person's idea.
Dunno if you looked at it. My security objective is
about as important as locking up shed if you keep
some costly tools in it. That is, I'll spring for a pad-
lock - but I'm not going to buy a used, walk-in bank
vault.
Really, I could write a routine to shuffle and cut the
string a few times - like a deck of cards. Honestly,
if I found example code posted that doessomething
like that - I'd probably just go with it.
A routine to do a "Caesar cipher" is simple to write. This is definitely
not high-end security, but it will keep casual eyes from seeing anything
of value.
This is totally untested and sleazy code, but maybe it will give you
some ideas:
==== Code Begin
Function Encrypt(SomeTex t As String) As String
' Loop through the input, shifting each character's ASCII value
Dim i As Long
Dim tmp As String
For i = 1 To Len(SomeText)
tmp = tmp + Shift(Mid(SomeT ext, i, 1))
Next i
Encrypt = tmp
End Function
Function Shift(SomeChar As String) As String
' Shift the input character's ASCII value by 17
' but only if its ASCII value is in [32..126]
Dim n As Integer
n = Asc(SomeChar)
If n >= 32 And n <= 126 Then
n = n + 17
If n > 126 Then n = n - 126 + 32
Shift = Chr(n)
Else
Shift = SomeChar
End If
End Function
==== Code End
? encrypt ("Smartin")
d~r%'z!
The procedure to reverse the "encryption " would be pretty simple to do.
--
Smartin