Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX... 
Author Message
 Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

' The code you'll need is just below
' The logic used here is to get the character's corresponding ASCII code,
change its bit positions and getting the new ASCII code's respective
character.

'This e-mail was posted by
'Luciano Evaristo Guerche

'S?o Paulo, SP, Brazil

Option Explicit

Const conOriginalBit0 As Byte = 0
Const conOriginalBit1 As Byte = 1
Const conOriginalBit2 As Byte = 2
Const conOriginalBit3 As Byte = 3
Const conOriginalBit4 As Byte = 4
Const conOriginalBit5 As Byte = 5
Const conOriginalBit6 As Byte = 6
Const conOriginalBit7 As Byte = 7

Dim aNewBitPosition(0 To 7)

Sub NewBitPositionsInicialize()
    Static blnInicialized As Boolean
    If blnInicialized Then
        Exit Sub
    End If
    aNewBitPosition(conOriginalBit0) = 7
    aNewBitPosition(conOriginalBit1) = 6
    aNewBitPosition(conOriginalBit2) = 4
    aNewBitPosition(conOriginalBit3) = 5
    aNewBitPosition(conOriginalBit4) = 3
    aNewBitPosition(conOriginalBit5) = 2
    aNewBitPosition(conOriginalBit6) = 0
    aNewBitPosition(conOriginalBit7) = 1
    blnInicialized = True
End Sub

Public Function Encrypt(strOriginalKey As String) As String
    Dim bytCurrentOriginalBit   As Byte
    Dim lngCharIndex            As Long
    Dim lngCurrentChar          As Long
    Dim lngEncryptedChar        As Long
    Dim strEncryptedKey         As String
    NewBitPositionsInicialize
    strEncryptedKey = String(Len(strOriginalKey), " ")
    For lngCharIndex = 1 To Len(strOriginalKey)
        lngCurrentChar = Asc(Mid(strOriginalKey, lngCharIndex, 1))

        lngEncryptedChar = 0
        For bytCurrentOriginalBit = 0 To 7
            If bytCurrentOriginalBit <
aNewBitPosition(bytCurrentOriginalBit) Then
                lngEncryptedChar = lngEncryptedChar + ((lngCurrentChar And 2
^ bytCurrentOriginalBit) * 2 ^ (aNewBitPosition(bytCurrentOriginalBit) -
bytCurrentOriginalBit))
            Else
                lngEncryptedChar = lngEncryptedChar + ((lngCurrentChar And 2
^ bytCurrentOriginalBit) / 2 ^ (bytCurrentOriginalBit -
aNewBitPosition(bytCurrentOriginalBit)))
            End If
        Next
        Mid(strEncryptedKey, lngCharIndex, 1) = Chr(lngEncryptedChar)
    Next
    Encrypt = strEncryptedKey
End Function

Public Function Decrypt(strEncryptedKey As String) As String
    Dim bytCurrentOriginalBit   As Byte
    Dim lngCharIndex            As Long
    Dim lngCurrentChar          As Long
    Dim lngOriginalChar         As Long
    Dim strOriginalKey          As String
    NewBitPositionsInicialize
    strOriginalKey = String(Len(strEncryptedKey), " ")
    For lngCharIndex = 1 To Len(strEncryptedKey)
        lngCurrentChar = Asc(Mid(strEncryptedKey, lngCharIndex, 1))

        lngOriginalChar = 0
        For bytCurrentOriginalBit = 0 To 7
            If aNewBitPosition(bytCurrentOriginalBit) <
bytCurrentOriginalBit Then
                lngOriginalChar = lngOriginalChar + ((lngCurrentChar And 2 ^
aNewBitPosition(bytCurrentOriginalBit)) * 2 ^ (bytCurrentOriginalBit -
aNewBitPosition(bytCurrentOriginalBit)))
            Else
                lngOriginalChar = lngOriginalChar + ((lngCurrentChar And 2 ^
aNewBitPosition(bytCurrentOriginalBit)) / 2 ^
(aNewBitPosition(bytCurrentOriginalBit) - bytCurrentOriginalBit))
            End If
        Next
        Mid(strOriginalKey, lngCharIndex, 1) = Chr(lngOriginalChar)
    Next
    Decrypt = strOriginalKey
End Function



Fri, 07 Sep 2001 03:00:00 GMT  
 Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...
' The code you'll need is just below
' The logic used here is to get the character's corresponding ASCII code,
change its bit positions and getting the new ASCII code's respective
character.

' This e-mail was posted by
' Luciano Evaristo Guerche

' S?o Paulo, SP, Brazil

Option Explicit

Const conOriginalBit0 As Byte = 0
Const conOriginalBit1 As Byte = 1
Const conOriginalBit2 As Byte = 2
Const conOriginalBit3 As Byte = 3
Const conOriginalBit4 As Byte = 4
Const conOriginalBit5 As Byte = 5
Const conOriginalBit6 As Byte = 6
Const conOriginalBit7 As Byte = 7

Dim aNewBitPosition(0 To 7)

Sub NewBitPositionsInicialize()
    Static blnInicialized As Boolean
    If blnInicialized Then
        Exit Sub
    End If
    aNewBitPosition(conOriginalBit0) = 7
    aNewBitPosition(conOriginalBit1) = 6
    aNewBitPosition(conOriginalBit2) = 4
    aNewBitPosition(conOriginalBit3) = 5
    aNewBitPosition(conOriginalBit4) = 3
    aNewBitPosition(conOriginalBit5) = 2
    aNewBitPosition(conOriginalBit6) = 0
    aNewBitPosition(conOriginalBit7) = 1
    blnInicialized = True
End Sub

Public Function Encrypt(strOriginalKey As String) As String
    Dim bytCurrentOriginalBit   As Byte
    Dim lngCharIndex            As Long
    Dim lngCurrentChar          As Long
    Dim lngEncryptedChar        As Long
    Dim strEncryptedKey         As String
    NewBitPositionsInicialize
    strEncryptedKey = String(Len(strOriginalKey), " ")
    For lngCharIndex = 1 To Len(strOriginalKey)
        lngCurrentChar = Asc(Mid(strOriginalKey, lngCharIndex, 1))

        lngEncryptedChar = 0
        For bytCurrentOriginalBit = 0 To 7
            If bytCurrentOriginalBit <
aNewBitPosition(bytCurrentOriginalBit) Then
                lngEncryptedChar = lngEncryptedChar + ((lngCurrentChar And 2
^ bytCurrentOriginalBit) * 2 ^ (aNewBitPosition(bytCurrentOriginalBit) -
bytCurrentOriginalBit))
            Else
                lngEncryptedChar = lngEncryptedChar + ((lngCurrentChar And 2
^ bytCurrentOriginalBit) / 2 ^ (bytCurrentOriginalBit -
aNewBitPosition(bytCurrentOriginalBit)))
            End If
        Next
        Mid(strEncryptedKey, lngCharIndex, 1) = Chr(lngEncryptedChar)
    Next
    Encrypt = strEncryptedKey
End Function

Public Function Decrypt(strEncryptedKey As String) As String
    Dim bytCurrentOriginalBit   As Byte
    Dim lngCharIndex            As Long
    Dim lngCurrentChar          As Long
    Dim lngOriginalChar         As Long
    Dim strOriginalKey          As String
    NewBitPositionsInicialize
    strOriginalKey = String(Len(strEncryptedKey), " ")
    For lngCharIndex = 1 To Len(strEncryptedKey)
        lngCurrentChar = Asc(Mid(strEncryptedKey, lngCharIndex, 1))

        lngOriginalChar = 0
        For bytCurrentOriginalBit = 0 To 7
            If aNewBitPosition(bytCurrentOriginalBit) <
bytCurrentOriginalBit Then
                lngOriginalChar = lngOriginalChar + ((lngCurrentChar And 2 ^
aNewBitPosition(bytCurrentOriginalBit)) * 2 ^ (bytCurrentOriginalBit -
aNewBitPosition(bytCurrentOriginalBit)))
            Else
                lngOriginalChar = lngOriginalChar + ((lngCurrentChar And 2 ^
aNewBitPosition(bytCurrentOriginalBit)) / 2 ^
(aNewBitPosition(bytCurrentOriginalBit) - bytCurrentOriginalBit))
            End If
        Next
        Mid(strOriginalKey, lngCharIndex, 1) = Chr(lngOriginalChar)
    Next
    Decrypt = strOriginalKey
End Function



Fri, 07 Sep 2001 03:00:00 GMT  
 Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...
Luciano, I can understand how it feels when world turns to magic ; when your
lines of code do what you expect them to do. I very encourage you to keep
research, creation and courage beeing your first qualities. Thank you for
this algorythm, but, how can I say that, it's a little bit *simple* to
protect any data with it. Keep on !

Sylvain
Hum, also, please try not to post (2 times!) your messages everywhere, it
takes us many time, and (here in France) we pay for time on line.



Sat, 08 Sep 2001 03:00:00 GMT  
 Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

to have created this little gem:

Quote:
>Hum, also, please try not to post (2 times!) your messages everywhere, it
>takes us many time, and (here in France) we pay for time on line.

And in the UK too....

--
Donald Gray
Putting ODCOMBE on the Global Village Map
http://www.odcombe.demon.co.uk/

(Please replace the 'NOSPAM' with 'odcombe' in my email address)



Sat, 08 Sep 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

2. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

3. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

4. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

5. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

6. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

7. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

8. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

9. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

10. Make your own ENCRYPTION/DECRYPTION EXE/DLL/OCX...

11. Making my own setup.exe file for my applications

12. Encryption/Decryption and Importing

 

 
Powered by phpBB® Forum Software