VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Encrypt Your Codes Into 8 Base Method. It's Simple Work 100%

by Buddhika Fernando (9 Submissions)
Category: Encryption
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 21st December 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Encrypt Your Codes Into 8 Base Method. It's Simple Work 100%

API Declarations



Rem --- Developed By Buddhika Fernando
Rem --- Programmer Vanik Information Technologies [ Sri Lanka ]
Rem --- For Your Comments [email protected]

Dim User_Text As String
Dim User_Text_Len As Double

Dim I_For As Double
Dim Char_Val As String

Dim Encrypt_Char As String
Dim Decrypt_Char As String

Rate Encrypt Your Codes Into 8 Base Method. It's Simple Work 100%




    Text1.Text = ""
    CmdEncrypt.Enabled = True
    CmdDecrypt.Enabled = False
    Text1.SetFocus
    
End Sub

Private Sub CmdDecrypt_Click()
    
    Dim I_Oct                       As Double
    Dim Len_Char_Val                As Integer
    Dim Oct_Val                     As Integer
    Dim B_Oct                       As Integer
    Dim Temp                        As Byte
    
    User_Text = "": User_Text = StrReverse(Text1.Text)
    Decrypt_Char = ""
    If User_Text = "" Then Exit Sub
    User_Text_Len = Len(User_Text)
    
    For I_For = 1 To User_Text_Len
        Char_Val = Asc(Mid(User_Text, I_For, 1))
        '----------------------------------------------------
            If Char_Val <= 245 Then Char_Val = Char_Val - 10
            Len_Char_Val = Len(Char_Val)
        '----------------------------------------------------
        Oct_Val = 0
        For I_Oct = 0 To Len_Char_Val - 1
            B_Oct = 8 ^ I_Oct
            If I_Oct = 0 Then Temp = B_Oct Else Temp = I_Oct + 1
            Oct_Val = CInt(Oct_Val) + CInt((B_Oct) * (Mid(StrReverse(Char_Val), Temp, 1)))
        Next I_Oct
        Decrypt_Char = Decrypt_Char & Chr(Oct_Val)
    Next I_For
    
    Text1.Text = Decrypt_Char
    CmdEncrypt.Enabled = True
    CmdDecrypt.Enabled = False
    
End Sub

Private Sub CmdEncrypt_Click()
    
    Dim Check_Val                   As Byte
    
    Check_Val = 0
    User_Text = "": User_Text = Text1.Text
    Encrypt_Char = ""
    If User_Text = "" Then Exit Sub
    User_Text_Len = Len(User_Text)
    
    For I_For = 1 To User_Text_Len
        Char_Val = Asc(Mid(User_Text, I_For, 1))
        '--------------------------------------------
            Check_Val = 0: Check_Val = Oct(Char_Val)
        '--------------------------------------------
        If Check_Val >= 245 Then
            Encrypt_Char = Encrypt_Char & Chr(Check_Val)
        Else
            Check_Val = Check_Val + 10
            Encrypt_Char = Encrypt_Char & Chr(Check_Val)
        End If
    Next I_For
    
    Text1.Text = StrReverse(Encrypt_Char)
    CmdEncrypt.Enabled = False
    CmdDecrypt.Enabled = True
    
End Sub

Private Sub Form_Load()
    
    CmdEncrypt.Enabled = True
    CmdDecrypt.Enabled = False
    
End Sub

Download this snippet    Add to My Saved Code

Encrypt Your Codes Into 8 Base Method. It's Simple Work 100% Comments

No comments have been posted about Encrypt Your Codes Into 8 Base Method. It's Simple Work 100%. Why not be the first to post a comment about Encrypt Your Codes Into 8 Base Method. It's Simple Work 100%.

Post your comment

Subject:
Message:
0/1000 characters