Skip to content

Instantly share code, notes, and snippets.

@parsons-Jsr
Last active December 15, 2015 20:48
Show Gist options
  • Save parsons-Jsr/5321046 to your computer and use it in GitHub Desktop.
Save parsons-Jsr/5321046 to your computer and use it in GitHub Desktop.
EncryptedChrome v0.7(Previously Secret Chrome w/ Encryption) Code includes batch file code for program only. The previous setup file has been replaced with IF statements as a switch. In Real World project- batch file exists as an exe. Also quiet mode is induced on said exe with attached jScript
@echo off
::JSRP ENCRYPTEDCHROME (GOOGLE CHROME PORTABLE WITH AXCRYPT ENCRYPTION) SCRIPT
::AXCRYPT ARGUMENTS (REFERENCE)
::-m (recursive), -d (decrypt), -b (use batch id), -f(fast mode), -z(encrypt), -t(destroy cached password)
::EDITVAR ARGUMENTS (REFERENCE)
::-p (pass), -m (mask input), -b (direct input to start of var), -o (set input to overwrite)
::USER INSTALL PATHS (CHANGE IF FOLDER NAMES CHANGE)
set ax=AxCrypt
set chrome=GoogleChromePortable
::DECLARE ENVIR. VARS
::[main] String to hold commands to be passed to 'cmd /k' for main
::[setup] String to hold commands to be passed to 'cmd /k' for setup
::[firsTime] Boolean switch to run first time encryption code if chrome is not already encrypted
::[pass] String to hold password to pass into Axcrypt to decrypt/encrypt (cannot be blank as editvar needs content to overwrite)
::[tempPassx] Strings for password validation. Must be initialised to different values so that they appear initially incorrect
set main=
set setup=
set firstTime=
set PASS=
set tempPassA=
set tempPassB=
::set colour
COLOR 17
::If encryption not present, goto setup code
IF EXIST Files\%chrome%\GoogleChromePortable.exe GOTO Setup
::Else goto main code
GOTO Main
::Code for initial encryption
::----------------Setup Code START----------------
:Setup
::set firstTime Flag, print title
set firstTime=1
set setup= %setup% && echo ###########################################
set setup= %setup% && echo JSRP- EncryptedChrome FIRST TIME SETUP
set setup= %setup% && echo ###########################################
set setup= %setup% && cd Files
set setup= %setup% && echo.
::Dectect architecture and print it
set setup= %setup% && IF defined ProgramFiles(x86) (echo detected 64-bit Windows)
set setup= %setup% && IF defined ProgramFiles(x86) (echo.)
set setup= %setup% && IF NOT defined ProgramFiles(x86) (echo detected 32-bit Windows)
set setup= %setup% && IF NOT defined ProgramFiles(x86) (echo.)
::Prompt for input
set setup= %setup% && echo Please select a password for the encryption and type it below...
set setup= %setup% && cd EditVar
set setup= %setup% && GOTO PassValidation
:PassValidation
::Use editVar instead of 'set /p' for masking text, version used depends on architecture
set setup= %setup% && IF defined ProgramFiles(x86) (editv64 -b -m -o -p "password: " tempPassA)
set setup= %setup% && IF defined ProgramFiles(x86) (editv64 -b -m -o -p " confirm: " tempPassB)
set setup= %setup% && IF NOT defined ProgramFiles(x86) (editv32 -b -m -o -p "password: " tempPassA)
set setup= %setup% && IF NOT defined ProgramFiles(x86) (editv32 -b -m -o -p " confirm: " tempPassB)
::Only continue when passwords match
set setup= %setup% && IF %tempPassA%==%tempPassB% (set pass=%tempPassA%)
set setup= %setup% && IF %tempPassA%==%tempPassB% (GOTO Continue)
set setup= %setup% && IF NOT %tempPassA%==%tempPassB% (GOTO IncorrectPass)
:IncorrectPass
::If passwords dont match, reset vars and repeat valdiation block
set setup= %setup% && echo.
set setup= %setup% && echo Passwords do not match! Please try again...
set setup= %setup% && set tempPassA=
set setup= %setup% && set tempPassB=
set setup= %setup% && GOTO PassValidation
:Continue
::Continue when passwords match, print out progress
set setup= %setup% && cd ../%ax%
set setup= %setup% && echo.
::Wipe pre-existing axcrypt password cache
set setup= %setup% && Axcrypt.exe -t
set setup= %setup% && echo cache wiped
::Change reg values to custom ones (Hence enable server Mode)
set setup= %setup% && regedit.exe /s ../RegistryFiles/Install_reg_values.reg
set setup= %setup% && echo registry values installed
set setup= %setup% && echo server mode started
set setup= %setup% && echo.
set setup= %setup% && echo Encrypting Chrome, please wait...
::Encrypt
set setup= %setup% && Axcrypt.exe -b 2 -m -e -k %pass% -z ../%chrome%/*
::Mask filenames of chrome files
set setup= %setup% && Axcrypt.exe -b 2 -m -h ../%chrome%/*
set setup= %setup% && echo Filenames masked
set setup= %setup% && echo.
set setup= %setup% && echo Encryption complete! Re-run to Use Program
set setup= %setup% && regedit.exe /s ../RegistryFiles/Remove_reg_values.reg
set setup= %setup% && pause
GOTO Execute
::----------------Setup Code END------------------
::--------------Main Code START------------------
::Code for main decrypt-enctrpyt
:Main
:: Echo Title
set main= %main% && echo ###################################
set main= %main% && echo JSRP- EncryptedChrome Terminal
set main= %main% && echo ###################################
set main= %main% && cd Files
set main= %main% && echo.
set main= %main% && echo Please Enter your decryption password below (NOTE: Program will force-quit on incorrect password)
::Passes password which is masked to 'pass' var
set setup= %setup% && cd EditVar
set main= %main% && IF defined ProgramFiles(x86) (editv64 -b -m -o -p "password: " pass)
set main= %main% && IF NOT defined ProgramFiles(x86) (editv32 -b -m -o -p "password: " pass)
set main= %main% && echo.
::custom reg values
set main= %main% && regedit.exe /s ../RegistryFiles/Install_reg_values.reg
set main= %main% && echo server mode started
::decrypt
set main= %main% && echo.
set main= %main% && cd ../%ax%
set main= %main% && Axcrypt -b 2 -m -k %pass% -d ../%chrome%/*.axx
::Multiple IF EXISTS, exist here for text control on force-quit
::Open Chrome once decrypted and wait for program to kill
set main= %main% && IF EXIST ../%chrome%\GoogleChromePortable.exe echo Decryption complete! Opening Chrome...
set main= %main% && IF EXIST ../%chrome%\GoogleChromePortable.exe START /w ../%chrome%\GoogleChromePortable.exe
::Re-encrypt program after it is killed then quit
set main= %main% && echo.
set main= %main% && echo Secret Chrome closed. Please wait while it is reencrypted...
::mask filenames
set main= %main% && Axcrypt.exe -b 2 -m -h ../%chrome%/*
::encrypt
set main= %main% && IF EXIST ../%chrome%\GoogleChromePortable.exe Axcrypt.exe -b 2 -m -h -e -k %pass% -z ../%chrome%/* -t
::mask filenames
set main= %main% && Axcrypt.exe -b 2 -m -h ../%chrome%/*
::default reg values
set main= %main% && regedit.exe /s ../RegistryFiles/Remove_reg_values.reg
set main= %main% && echo server mode stopped
set main= %main% && exit
GOTO Execute
::--------------Main Code END-------------------
::----------------Execute Code START------------------
:Execute
::IF firstTime flag activated overwrite main with setup code instead
IF [%firstTime%]==1 (%main% = %setup%)
cmd.exe /k "%main%"
GOTO End
::----------------Execute Code END------------------
::EOF
:End
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Axantum\AxCrypt]
"SaveEncKey"=dword:00000000
"SaveDecKey"=dword:00000000
"ServerMode"=dword:00000001
-----------------------------------------------------------------------------
JSRP Google chrome portable w/ Automatic axcrypt encryption (EncryptedChrome) VERSION 0.7
-----------------------------------------------------------------------------
############################################################################################################
DO NOT FORCE THE COMMAND WINDOWS TO QUIT AT ANY TIME
ESPECIALLY WHEN THE BROWSER IS RUNNING AS THIS MAY STOP THE BROWSER FROM BEING ENCRYPTED UNTIL THE NEXT RUN!
############################################################################################################
0. Extract Files to a sensible location for keeping (e.g. 'C:/' , 'Program Files', 'Documents')
1. Run EncryptedChrome07.exe by double clicking it
2. The first time you run this, the program will prompt you for your encryption password choice.
Type in the password twice. If the passwords do not match you will have to enter them again.
3. Wait 5-20 seconds for the files to encrypt (time cpu & hdd dependant)
4. You can now either re-run EncryptedChrome.exe
5. Type in your password and wait 5-20 seconds for the files to decrypt. If you enter a wrong password, the
program will force-quit and have to run again
6. A Google Chrome Session should now appear.
7. After you're done with the browser session close the google chrome window and wait for the
re-encryption to complete. If you close the command window in the time, encryption will complete,
however file names will not be masked!
8. ENJOY ENCRYPTED BROWSING
------
NOTES:
------
* If you want a new password its best to extract a new copy from the zip so keep the zip handy!
* Create a shortcut of the Exe of your choice and place it in the Start menu for easy access
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Axantum\AxCrypt]
"SaveEncKey"=dword:00000000
"SaveDecKey"=dword:00000000
"ServerMode"=dword:00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment