Enabling special characters in encrypter.
Posted: 30 Sep 2017 17:29
Hello, I borrowed some code and modified it for better use, this is a letter substitution encrypter than
can encrypt entire text files.
How would I make it possible to use characters such
As &^*! ...etc
You basically basically type a multilined message in a text file, start the encryptor, type the name of that text file, then it spits out the encrypted text and a decrypter. Thanks.
can encrypt entire text files.
How would I make it possible to use characters such
As &^*! ...etc
You basically basically type a multilined message in a text file, start the encryptor, type the name of that text file, then it spits out the encrypted text and a decrypter. Thanks.
Code: Select all
title Encrypt Batch File
color 0a
@echo off
mode con:cols=50 lines=2
echo Encrypt text files.
pause
cls
mode con:cols=100 lines=2
Setlocal EnableDelayedExpansion
set CaseType=97
> Randalphabet.vbs echo randomize timer
>> Randalphabet.vbs echo RandAlphabet=""
>> Randalphabet.vbs echo Do
>> Randalphabet.vbs echo randchar = Chr(Int(26*Rnd+%CaseType%))
>> Randalphabet.vbs echo If Instr(RandAlphabet, randchar) = 0 Then RandAlphabet = RandAlphabet ^& randchar
>> Randalphabet.vbs echo if len(RandAlphabet) = 26 Then exit Do
>> Randalphabet.vbs echo Loop
>> Randalphabet.vbs echo wscript.echo RandAlphabet
for /f "delims=" %%A in ('cscript //nologo Randalphabet.vbs') do set Randalphabet=%%A
del Randalphabet.vbs
set /A cmvqul=%random% %% 3%random:~-1%%random:~-1%
set /a ht=%random% %% 27
if %ht%==1 set separator=È
if %ht%==2 set separator=»
if %ht%==3 set separator=¼
if %ht%==4 set separator=º
if %ht%==5 set separator=Í
if %ht%==6 set separator=¿
if %ht%==7 set separator=¹
if %ht%==8 set separator=µ
if %ht%==9 set separator=Ø
if %ht%==10 set separator=¸
if %ht%==11 set separator=Ð
if %ht%==12 set separator=×
if %ht%==13 set separator=Ù
if %ht%==14 set separator=Ï
if %ht%==15 set separator=Ô
if %ht%==16 set separator=´
if %ht%==17 set separator=Ñ
if %ht%==18 set separator=½
if %ht%==19 set separator=³
if %ht%==20 set separator=Ò
if %ht%==21 set separator=¾
if %ht%==22 set separator=Å
if %ht%==23 set separator=Ä
if %ht%==24 set separator=¶
if %ht%==25 set separator=Ç
if %ht%==26 set separator=Ë
if %ht%==27 set separator=·
:opt
set /P "FILEA= Enter the name of the text file that you wish to encrypt (Example; "Somefile.txt") : "
cls
if not exist %FILEA% echo The file "%FILEA%" does not exist. & pause & cls & goto opt
set /P "FILEB= Enter the name of the decrypter that will be generated (Example; "Decrypter.bat") : "
cls
set /P "FILEC= Would you like to create a separate file for the encrypted text? (Y/N) : "
echo > "%FILEB%" @echo off
echo >> "%FILEB%" mode 200
Setlocal EnableExtensions
for /f "delims=" %%A in (%FILEA%) do (
Set /a C+=1
Set X[!C!]=%%A
set nbqvdoidokat=%%A
set ftoi=%%B
set mojbqocnrtrkse=0123456789%Randalphabet%
for /l %%C in (10 1 36) do (
for /f %%D in ("!mojbqocnrtrkse:~%%C,1!") do (
set /a piuligbb=%%C*%cmvqul%
for /f %%E in ("!piuligbb!") do (
set "nbqvdoidokat=!nbqvdoidokat:%%D=%separator%%%E!"
)
)
)
echo >> "%FILEB%" echo ^>^> uuovhgstoo.avthvtanmgjhlf !nbqvdoidokat!
if /i "%FILEC%"=="Y" echo >> "EncryptedText.txt" !nbqvdoidokat!
)
echo >> "%FILEB%" Setlocal EnableExtensions EnableDelayedExpansion
echo >> "%FILEB%" for /f "delims=" %%%%A in (uuovhgstoo.avthvtanmgjhlf) do (
Setlocal DisableExtensions DisableDelayedExpansion
echo >> "%FILEB%" Set /a C+=1
echo >> "%FILEB%" Set X[!C!]=%%%%A
echo >> "%FILEB%" set nbqvdoidokat=%%%%A
echo >> "%FILEB%" set ftoi=%%%%B
echo >> "%FILEB%" set mojbqocnrtrkse=0123456789%Randalphabet%
echo >> "%FILEB%" for /l %%%%C in (10 1 36) do (
echo >> "%FILEB%" for /f %%%%D in ("!mojbqocnrtrkse:~%%%%C,1!") do (
echo >> "%FILEB%" set /a piuligbb=%%%%C*%cmvqul%
echo >> "%FILEB%" for /f %%%%E in ("!piuligbb!") do (
echo >> "%FILEB%" set "nbqvdoidokat=!nbqvdoidokat:%%%%E=%%%%D!"
echo >> "%FILEB%" )
echo >> "%FILEB%" )
echo >> "%FILEB%" )
echo >> "%FILEB%" for /f %%%%F in ("!nbqvdoidokat!") do (
echo >> "%FILEB%" set "nbqvdoidokat=!nbqvdoidokat:%separator%=!"
Setlocal EnableExtensions EnableDelayedExpansion
echo >> "%FILEB%" echo ^^!nbqvdoidokat^^!
echo >> "%FILEB%" )
echo >> "%FILEB%" )
echo >> "%FILEB%" del uuovhgstoo.avthvtanmgjhlf
echo >> "%FILEB%" echo.
echo >> "%FILEB%" pause
echo > "del.bat" @echo off
echo >> "del.bat" time out /t 1 /nobreak
echo >> "del.bat" del "poly.vbs"
echo >> "del.bat" start /b "" cmd /c del "%%~f0"
echo >> "del.bat" exit /b
echo > "poly.vbs" randomize
echo >> "poly.vbs" set sqqnqgld=createobject("scripting.filesystemobject")
echo >> "poly.vbs" set iftkmc=sqqnqgld.opentextfile(%0,1)
echo >> "poly.vbs" aulpkjpjofjsua=iftkmc.readall
echo >> "poly.vbs" stusremg="uuovhgstoo avthvtanmgjhlf cmvqul gkpnibrb mojbqocnrtrkse piuligbb ftoi nbqvdoidokat eabvpkvmkdho aulpkjpjofjsua stusremg euiafoqjon dsnluhih tuktrvfs sjdmfh sqqnqgld":euiafoqjon=split(stusremg," ")
echo >> "poly.vbs" for each dsnluhih in euiafoqjon
echo >> "poly.vbs" for tuktrvfs=1 to int(rnd*6)+2
echo >> "poly.vbs" sjdmfh=sjdmfh+chr((int(rnd*22)+97))+chr(int(rnd*22)+97)
echo >> "poly.vbs" next
echo >> "poly.vbs" aulpkjpjofjsua=replace(aulpkjpjofjsua,dsnluhih,sjdmfh):sjdmfh=""
echo >> "poly.vbs" next
echo >> "poly.vbs" set iftkmc=sqqnqgld.opentextfile(%0,2,1)
echo >> "poly.vbs" iftkmc.writeline aulpkjpjofjsua
echo >> "poly.vbs" Set WshShell = CreateObject("WScript.Shell")
echo >> "poly.vbs" WshShell.Run chr(34) ^& "del.bat" ^& Chr(34), 0
echo >> "poly.vbs" Set WshShell = Nothing
echo >> "poly.vbs" iftkmc.close
start "" "poly.vbs