Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Note: This scipt is an Independant Subprogram.
- Hybrid Batch Vbs Encrypter / Decrypter for passwords or other variables.
- Performs the action on data stored in the defined file - does not create the file.
- Note: file extension in vbs to match the filetype you save password/text to.
- To use this program Call it with the name of the Variable you wish to set and the offset to perform.
- Call it with a positive offset (IE: +26) to encrypt, and an equivalent Negative offset to Decrypt. (IE: -26)
- ::: However your Main program takes user input:
- Set /p YourVariableName=
- ::: Store the Input to a File
- CALL "Insert Filepath To Encrypter.bat Here" YourVariableName +26
- ::: Begin Program; Encrypter.bat
- @ECHO OFF
- REM :: Do NOT modify the variable names Below, DO INSERT the filepath you used to Store the Data Being Encrypted / Decrypted.
- Set "VarName=%~1"
- Set "offset=%~2"
- Set "SaveLoc=Your Filepath Here"
- <"%saveLoc%" (
- Set /p encryptData=
- )
- (
- ECHO Dim objFSO 'File System Object
- ECHO Set objFSO = CreateObject("Scripting.FileSystemObject"^)
- ECHO Dim objTS 'Text Stream Object
- ECHO Const ForWriting = 2
- ECHO Set objTS = objFSO.OpenTextFile("%SaveLoc%", ForWriting, True^)
- ECHO objTS.Write(encode("%encryptData%"^)^)
- ECHO wscript.sleep "1000"
- ECHO function encode(s^)
- ECHO For i = 1 To Len(s^)
- ECHO newtxt = Mid( s, i, 1^)
- ECHO newtxt = Chr(Asc(newtxt^) %offset%^)
- ECHO coded = coded + (newtxt^)
- ECHO Next
- ECHO encode = coded
- ECHO End function
- ECHO objTS.Close(^)
- ECHO Set bjFSO = Nothing 'Destroy the object.
- ECHO Set objTS = Nothing 'Destroy the object.
- ) >%TEMP%\encrypter.vbs
- START /wait %TEMP%\encrypter.vbs
- DEL /Q "%TEMP%\encrypter.vbs"
- GOTO :EOF
Add Comment
Please, Sign In to add comment