T3RRYT3RR0R

Batch / Vbs variable Encrypter (For passwords or other data)

Dec 21st, 2019
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.83 KB | None | 0 0
  1. Note: This scipt is an Independant Subprogram.
  2.  
  3. Hybrid Batch Vbs Encrypter / Decrypter for passwords or other variables.
  4. Performs the action on data stored in the defined file - does not create the file.
  5.  
  6. Note: file extension in vbs to match the filetype you save password/text to.
  7.  
  8. To use this program Call it with the name of the Variable you wish to set and the offset to perform.
  9.  
  10. Call it with a positive offset (IE: +26) to encrypt, and an equivalent Negative offset to Decrypt. (IE: -26)
  11.  
  12.     ::: However your Main program takes user input:
  13.     Set /p YourVariableName=
  14.     ::: Store the Input to a File
  15.    
  16.     CALL "Insert Filepath To Encrypter.bat Here" YourVariableName +26
  17.  
  18.     ::: Begin Program; Encrypter.bat
  19.     @ECHO OFF
  20.    
  21.     REM :: Do NOT modify the variable names Below, DO INSERT the filepath you used to Store the Data Being Encrypted / Decrypted.
  22.  
  23.     Set "VarName=%~1"
  24.     Set "offset=%~2"
  25.     Set "SaveLoc=Your Filepath Here"
  26.    
  27.     <"%saveLoc%" (
  28.     Set /p encryptData=
  29.     )
  30.    
  31.     (
  32.     ECHO Dim objFSO 'File System Object
  33.     ECHO Set objFSO = CreateObject("Scripting.FileSystemObject"^)
  34.     ECHO Dim objTS 'Text Stream Object
  35.     ECHO Const ForWriting = 2
  36.     ECHO Set objTS = objFSO.OpenTextFile("%SaveLoc%", ForWriting, True^)
  37.     ECHO objTS.Write(encode("%encryptData%"^)^)
  38.     ECHO wscript.sleep "1000"
  39.     ECHO function encode(s^)
  40.    
  41.     ECHO For i = 1 To Len(s^)
  42.     ECHO newtxt = Mid( s, i, 1^)
  43.     ECHO newtxt = Chr(Asc(newtxt^) %offset%^)
  44.     ECHO coded = coded + (newtxt^)
  45.     ECHO Next
  46.     ECHO encode = coded
  47.     ECHO End function
  48.     ECHO objTS.Close(^)
  49.     ECHO Set bjFSO = Nothing 'Destroy the object.
  50.     ECHO Set objTS = Nothing 'Destroy the object.
  51.     ) >%TEMP%\encrypter.vbs
  52.    
  53.     START /wait %TEMP%\encrypter.vbs
  54.    
  55.     DEL /Q "%TEMP%\encrypter.vbs"
  56.    
  57.     GOTO :EOF
Add Comment
Please, Sign In to add comment