dimanche 19 avril 2020

VBS encryption and decryptor

i am making a encryptor and a decryptor as you can see I use the alphabet and then + and - letters but when i type something in ht encryptor and copie that and do the copied message in the decryptor i dont get the word that i typed

intAnswer = _
    MsgBox("ja = Versleutelen" & VbCrLf & VbCrLf & "nee = ontcijferen", _
        vbyesno)
    If intAnswer = vbyes Then

    set x = WScript.CreateObject("WScript.Shell")
    encrypt = inputbox("type text om te versleutelen")
    encrypt = StrReverse(encrypt)
    x.Run "%windir%\notepad"
    wscript.sleep 1000
    x.sendkeys encode(encrypt)

    function encode(s)
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)+5-2+1)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)+2-3+4)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)-2+7-4+1)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)+4-2+7-1)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)-7+3-5+1)
    encrypt = StrReverse(encrypt)
    coded = coded & newtxt
    Next
    encode = coded
    End Function 

    Else
    set y = WScript.CreateObject("WScript.Shell")
    encrypt = inputbox("type text om te ontcijferen")
    encrypt = StrReverse(encrypt)
    y.Run "%windir%\notepad"
    wscript.sleep 1000
    y.sendkeys encode(encrypt)

    function encode(s)
    For i = 1 To Len(s)
    newtxt = Mid(s, i, 1)
    newtxt = Chr(Asc(newtxt)-5+2-1)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)+2-3-4)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)+2-7+4-1)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)-4+2-7+1)
    encrypt = StrReverse(encrypt)
    newtxt = Chr(Asc(newtxt)+7-3+5-1)
    coded = coded & newtxt
    Next
    encode = coded
    End Function 

    End If

what must i chance to let the code work

Aucun commentaire:

Enregistrer un commentaire