You are here

Encryption for portable firefox

7 posts / 0 new
Last post
Thrice
Offline
Last seen: 17 years 6 months ago
Joined: 2006-10-26 15:09
Encryption for portable firefox

I just wrote up a short batch script that uses 7zip's encryption to pack up portablefirefox's data folder. Since running firefox from the USB gives such a perfomance hit, my script basically copies the portablefirefox folder to c:\temp & extracts the data folder. When I'm done browsing, I tell it to pack up the data folder back to my thumb drive & delete everything else. It can use a keyfile, or a manual password as I want it to.

I imagine such a thing would be easy to officially implement. It's only a 10 line script which anybody with a bit of programming experience could do. I can post it here if anyone wants it. Any chance something like it could be added to the official version?

rich.bradshaw
Offline
Last seen: 10 years 10 months ago
Joined: 2006-10-05 08:41
I don't notice much of a

I don't notice much of a performance hit off my drive - guess it depends on your drive's speed. Seems a good idea though - why bother with encryption though, as the file is unencrypted to let it run on the host pc...

azjerry
Offline
Last seen: 6 years 7 months ago
Joined: 2005-12-09 12:42
I imagine

the idea is provide better security of the data on the flash drive itself in case it gets stolen. I wouldn't mind seeing his batch file myself.

Thrice
Offline
Last seen: 17 years 6 months ago
Joined: 2006-10-26 15:09
hmm

I actually just split it into 2 batch files. Seems easier to avoid making mistakes. Here comes the 1st.

@echo off
echo -------------
echo Extractor script
echo -------------

pause

IF NOT EXIST F:\key.txt (
echo Keyfile not found
pause
GOTO :EOF
)
FOR /F %%A IN (F:\key.txt) Do (
SET Pass=%%A
)

echo Extracting...
echo -----------------
xcopy FirefoxPortable C:\Temp\FirefoxPortable\ /E
"7-Zip\7z.exe" x C:\Temp\FirefoxPortable\Data.7z -oC:\Temp\FirefoxPortable\ -p%Pass%
start C:\Temp\FirefoxPortable\FirefoxPortable.exe

2nd file

@echo off
echo -------------
echo Retractor Script
echo -------------

pause

IF NOT EXIST F:\key.txt (
echo Keyfile not found
pause
GOTO :EOF
)
FOR /F %%A IN (F:\key.txt) Do (
SET Pass=%%A
)

echo Packing up firefox
echo -----------------
Tinyprograms\process -k firefox.exe
Tinyprograms\process -k pstart.exe

del FirefoxPortable\Data.7z.bak
ren Firefoxportable\Data.7z Data.7z.bak
"7-Zip\7z.exe" a Firefoxportable\Data.7z "C:\Temp\FirefoxPortable\Data" -p%Pass%
rmdir /s/q C:\Temp\FirefoxPortable\

A few notes:
I got some little program online for killing processes. That's the where the "-k firefox.exe" lines come from.

In terms of directory setup, there's FirefoxPortable & 7-zip folders on your thumb drive's root. Drive F: is another USB with the keyfile. If you leave out the "-p%Pass%" in the extractor script, it'll prompt you for the password.

tappet
Offline
Last seen: 4 years 3 months ago
Joined: 2006-01-04 20:32
Two Questions

Cool little scripts. I've been wondering how to do something like this, both for Firefox and for Thunderbird.

I have two questions:

1. Why extract to the C drive? It seems like that would leave un-encrypted traces if anything went wrong. Is there some advantage I'm not seeing?

2. Why the process-killer? Doesn't that create problems with Firefox not having been closed "properly?"

Tappet
__________________
"I am still learning."
--Socrates

Tappet
__________________
"I am still learning."
--Socrates

Thrice
Offline
Last seen: 17 years 6 months ago
Joined: 2006-10-26 15:09
Sometimes (rarely) firefox

Sometimes (rarely) firefox leaves the process running even after exiting. I figure it's not a good idea to pack up when it's running. I'm still on 1.5.0.7 & it doesn't complain when closed like that. I'm using the sessionsaver extension & I imagine it works just as well with 2.0's built in sessionsaver.

As for extracting to C, that one's been covered already Smile

Thrice
Offline
Last seen: 17 years 6 months ago
Joined: 2006-10-26 15:09
yeah

It's for better security on the drive for people who don't have admin rights to install something like truecrypt.

Topic locked