Public Function SimpleCrypt(ByVal Text As String) As String
' Encrypts/decrypts the passed string using a
' simple ASCII value-swapping algorithm
Dim strTempChar As String, i As Integer
For i = 1 To Len(Text)
If Asc(Mid$(Text, i, 1)) < 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) + 128, String)
ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) - 128, String)
End If
Mid$(Text, i, 1) = Chr(CType(strTempChar, Integer))
Next i
Return Text
End Function
'استدعي هذا التابع للتشفير وفك التشفير
Please SUBSCRIBE to get new articles directly into your Email inbox!
' Encrypts/decrypts the passed string using a
' simple ASCII value-swapping algorithm
Dim strTempChar As String, i As Integer
For i = 1 To Len(Text)
If Asc(Mid$(Text, i, 1)) < 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) + 128, String)
ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) - 128, String)
End If
Mid$(Text, i, 1) = Chr(CType(strTempChar, Integer))
Next i
Return Text
End Function
'استدعي هذا التابع للتشفير وفك التشفير
Please SUBSCRIBE to get new articles directly into your Email inbox!
تعليقات
إرسال تعليق