![Encrypt text document Encrypt text document](/uploads/1/2/6/3/126348043/508572010.png)
![Encrypt text in bat files Encrypt text in bat files](/uploads/1/2/6/3/126348043/767506781.png)
- REM UPDATES ON ENCRYPTER
- REM ; Generates a separator key from random.
- REM ; Creates entirely new encryption scheme each run.
- REM ; Now Possible to encrypt entire text files.
- title Encrypt Batch File
- @echo off
- echo Encrypt text files.
- cls
- > Randalphabet.vbs echo randomize timer
- >> Randalphabet.vbs echoDo
- >> Randalphabet.vbs echo randchar = Chr(Int(26*Rnd+%CaseType%))
- >> Randalphabet.vbs echoIf Instr(RandAlphabet, randchar) = 0 Then RandAlphabet = RandAlphabet ^& randchar
- >> Randalphabet.vbs echoif len(RandAlphabet) = 26 Then exitDo
- >> Randalphabet.vbs echo wscript.echo RandAlphabet
- for /f 'delims=' %%Ain('cscript //nologo Randalphabet.vbs')doset Randalphabet=%%A
- set /a key1=%random%%% 3%random:~-1%%random:~-1% + 1
- set /a key2=%random%%% 3%random:~-1%%random:~-1% + 1
- set /a key3=%random%%% 3%random:~-1%%random:~-1% + 1
- set /a key4=%random%%% 3%random:~-1%%random:~-1% + 1
- set /a key5=%random%%% 3%random:~-1%%random:~-1% + 1
- set /a count1=%random%%% 2
- if '%count1%'1' set 'math1=-' &set 'math2=+'
- if '%math2%'-' set 'math3=+' &set 'math4=-'
- set /a count2=%random%%% 27
- if%count2%2 set separator=»
- if%count2%4 set separator=º
- if%count2%6 set separator=¿
- if%count2%8 set separator=µ
- if%count2%10 set separator=¸
- if%count2%12 set separator=×
- if%count2%14 set separator=Ï
- if%count2%16 set separator=´
- if%count2%18 set separator=½
- if%count2%20 set separator=Ò
- if%count2%22 set separator=Å
- if%count2%24 set separator=¶
- if%count2%26 set separator=Ë
- set /p 'FILEA= Enter the name of the text file that you wish to encrypt (Example; 'Somefiletxt') : '
- ifnotexist%FILEA%echo The file '%FILEA%' does notexist. &pause& cls &goto options
- set /p 'FILEB= Enter the name of the decrypter that will be generated (Example; 'Decrypter.bat') : '
- set /p 'FILEC= Would you like to separate the encrypted text from the decrypter? (Y/N) : '
- echo> '%FILEB%' @echo off
- Setlocal EnableExtensions
- Set /a C+=1
- set code=%%A
- set chars=0123456789%Randalphabet%^|^^%%^&^<^>^{^}^[^]^(^)
- for /f %%Din('!chars:~%%C,1!')do(
- set /a math=%%C*%key1%*%key1%-%key1%/%key1%%math1%%key2%*%key2%-%key2%/%key2%%math2%%key3%*%key3%-%key3%/%key3%%math1%%key4%*%key4%-%key4%/%key4%%math4%%key5%*%key5%-%key5%/%key5%+5
- set 'code=!code:%%D=%separator%%%E!'
- )
- if /i '%FILEC%'N' echo>> '%FILEB%' echo^>^> lmotqocflhoi.txt !code!
- if /i '%FILEC%'Y' echo>> 'lmotqocflhoi.txt' !code!
- echo>> '%FILEB%' Setlocal EnableExtensions EnableDelayedExpansion
- echo>> '%FILEB%' for /f 'delims=' %%%%Ain(lmotqocflhoi.txt)do(
- Setlocal DisableExtensions DisableDelayedExpansion
- echo>> '%FILEB%' Set X[!C!]=%%%%A
- echo>> '%FILEB%' set pspfckinvcrn=0123456789%Randalphabet%^^^|^^^^%%%%^^^&^^^<^^^>^^^{^^^}^^^[^^^]^^^(^^^)
- echo>> '%FILEB%' for /f %%%%Din('!pspfckinvcrn:~%%%%C,1!')do(
- echo>> '%FILEB%' set /a qmgsmphoomrhmu=%%%%C*%key1%*%key1%-%key1%/%key1%%math1%%key2%*%key2%-%key2%/%key2%%math2%%key3%*%key3%-%key3%/%key3%%math1%%key4%*%key4%-%key4%/%key4%%math4%%key5%*%key5%-%key5%/%key5%+5
- echo>> '%FILEB%' for /f %%%%Ein('!qmgsmphoomrhmu!')do(
- echo>> '%FILEB%' set 'gcfnipvbergt=!gcfnipvbergt:%%%%E=%%%%D!'
- echo>> '%FILEB%' )
- echo>> '%FILEB%' for /f %%%%Fin('!gcfnipvbergt!')do(
- echo>> '%FILEB%' set 'gcfnipvbergt=!gcfnipvbergt:%separator%=!'
- echo>> '%FILEB%' echo^^!gcfnipvbergt^^!
- echo>> '%FILEB%' )
- if /i '%FILEC%'N' echo>> '%FILEB%' del lmotqocflhoi.txt
- echo>> '%FILEB%' pause
- echo> 'poly.vbs' randomize
- echo>> 'poly.vbs' set daeh=createobject('scripting.filesystemobject')
- echo>> 'poly.vbs' set iftkmc=daeh.opentextfile(%0,1)
- echo>> 'poly.vbs' gsvlabhrht='gcfnipvbergt pspfckinvcrn qmgsmphoomrhmu lmotqocflhoi':hheaqqhtloeset=split(gsvlabhrht,' ')
- echo>> 'poly.vbs' for each kbjalobheu in hheaqqhtloeset
- echo>> 'poly.vbs' tjai=tjai+chr((int(rnd*22)+97))+chr(int(rnd*22)+97)
- echo>> 'poly.vbs' lrur=replace(lrur,kbjalobheu,tjai):tjai='
- echo>> 'poly.vbs' set iftkmc=daeh.opentextfile(%0,2,1)
- echo>> 'poly.vbs' Set fso = CreateObject('Scripting.FileSystemObject')
- echo>> 'poly.vbs' fso.DeleteFile WScript.ScriptFullName
- start ' 'poly.vbs
If you want to find specific text in files, in a command line output or elsewhere, you may use the findstr command on Windows to do so. Findstr is a built-in tool of the Windows operating system that you may run from the command line to find text in files or in command line outputs. Windows has native support for file encryption. Today We are going to explain how to encrypt and decrypt files and directories in Windows using command line. Window had inbuilt cipher.exe for this purpose. So below are the ways how to use this command. Encrypt Files from Windows command line: To perform encryption in single.