* Remove almost all reliance on permanent variables. Only two permanent variables are used and those are paths to AxCrypt.exe and the Messenger.
* Some modifications of the code to fully work with PFA. Using PFA, you can now Encrypt, Decrypt, and Open encrypted files. Instead of the sorry mess before, the PFA is now simply:
Code: Select all
"AxCrypt - Open|<xydata>\Scripts\AX(Y)Crypt\AxCrypt.exe" axx>::Load "<xydata>\Scripts\AX(Y)Crypt.xys", "Open";
"AxCrypt - Encrypt|<xydata>\Scripts\AX(Y)Crypt\AxCrypt.exe" axx>::Load "<xydata>\Scripts\AX(Y)Crypt.xys", "Encrypt";
"AxCrypt - Decrypt|<xydata>\Scripts\AX(Y)Crypt\AxCrypt.exe" axx>::Load "Decrypt";Updated April 01, 2013 - Version 0.5
* Added icons. Menu looks much better now.
* Improperly used <curitem> variable. Now using <selitems> instead.
* Removed "Edit Script" since it's not needed.
Updated March 27, 2013 - Version 0.4
* Further code cleanup and some optimizations.
* Clean up itself after script is finished.
Updated March 26, 2013 - Version 0.3
* Implemented Customizable Secure Wipes
* Now uses a configuration file that allows configuration for:
-Encrypt to Self-Decrypting Executable
-Wipe Passes - The number of wipe passes for the original files after encryption and decryption.
-Wipe Passes on Demand - The number of wipe passes for secure wipe of selected files. Seperate from Wipe Passes above.
-Retain Original - Retain original files after encryption or decryption.
-Randomize Encrypted File Names
-Always quit AxCrypt - You will no longer have the convenience of cached keyphrases but you won't need to remember to quit AxCrypt. Also more secure.
* Cleaned up code.
Updated March 26, 2013 - Version 0.2
* Thanks to highend, finally combined folder & file encryption functions into one function.
* Wrote AX(Y)Script instead of AX(Y)Crypt in several places. Changed all back to AX(Y)Crypt.
* File layout have changed. AX(Y)Crypt.xys will be in the main <xyscripts> while the rest of the files will be in <xyscripts>\AX(Y)Crypt\. Help reduce clutter. Basically:
<XYScripts>
....\AX(Y)Crypt\
....AX(Y)Crypt.xys
....AX(Y)Crypt_Readme.txt
AxCrypt is an Explorer shell extension that is proven in stability, reliability, performance, and is generally well updated. It's also open sourced with very lenient permissions to freely modify and distribute. Although it's a shell extension, it can be called from the command line. The command line is fully featured and support every features that the shell extension offers.
One really nice feature is it allows you to edit encrypted files "on-the-fly". Basically it decrypt the file into a temporary location, open up the file using Windows type association, allows you to edit/view the file, waits for you to finish, and then automatically re-encrypt the file if it was edited.
"Double-click integration makes it as easy to open, edit and save protected files as it is to work with unprotected files." -Axantum
Although this feature is for use with Windows Explorer, it's actually usable even without being installed because there is actually a command line option for it which I made it work with XYplorer's PFA using Marco's slightly modified XYplorer Messenger. Using PFA, an encrypted file (extension .axx) is decrypted using AxCrypt that then sends the path of the temporary decrypted file to the messenger (AX(Y)Crypt_Hermes.exe) as a command parameter. The messenger then once again forward the control and path parameter to XYplorer as a command -::open "path"- which allows PFA to still be in effect.
Features
☆ Portable
☆ "Live Edit" Encrypted File with PFA: Can "live edit" encrypted files while still maintain PFA association. Double click to open an encrypted image -> PFA kicks in automatically with the temporary decrypted file -> Edit the file and close -> AxCrypt automatically re-encrypt the edited file without your intervention. Quicker and less hassle than: Decrypt File -> Double Click to Open File -> Edit/Save/Close File -> Start AX(Y)Crypt to Re-encrypt File.
☆ Randomize File Names: Can randomize encrypted file names. Original names are restored upon decryption.
☆ Customizable Secure Wipes
Setup
Requirements:
+ XYplorer Version 12.10.0001+
+ Scripting Enabled
+ AxCrypt (Included In Zip)
Extract all the contents of AX(Y)Crypt_{Version}.zip to the script folder. Then run AX(Y)Crypt_Button_Setup.xys or run ::Snippet from the address bar and paste in the following code:
Code: Select all
Snip: CTB 1
XYplorer 12.30.0000, 03.25.2013 00:00:00
Action
NewUserButton
Name
AX(Y)Crypt
Icon
<xyscripts>\AX(Y)Crypt\AxCrypt.exe
ScriptL
::load "<xyscripts>\AX(Y)Crypt.xys";
ScriptR
FireClick
0Code: Select all
/*
AX(Y)Crypt 0.6 April 10, 2013 - Portable File Encryption With AxCrypt - By Enternal
http://www.axantum.com/AxCrypt/
http://www.xyplorer.com/
Many thanks to Marco, highend
==== Main Files
AX(Y)Crypt.xys - Main Script
AX(Y)Crypt_Button_Setup - User Button Setup
AX(Y)Crypt_Hermes.exe - AX(Y)Crypt PFA Messenger - Slight Modification of Marco's XYplorer Messenger
AX(Y)Crypt_Hermes.a3u - AX(Y)Crypt PFA Messenger Source
AX(Y)Crypt_PFA - Raw PFA Code (Optional)
==== AxCrypt Files
AxCrypt.exe, AxDecrypt.exe, Config.xml, License.rtf, Messages.dll, ShellExt.dll, Sigs.xml
==== AxCrypt Command Line Information. For More Commands, Go to http://www.axantum.com/AxCrypt/CmdLine.html
-b n -> "Define a tag, or batch id, to be used with subsequent pass phrases."
-c -> Retain orinal files after encryption or decryption.
-g -> Do not encrypt already encrypted files.
-e -a -> Set Keyphrase (-e) and Prompt User (-a)
-m -> Recurse
-z -> Encrypt. Automatically wipes originals.
-d -> Decrypt
-h -> "Renames the to anonymous names. original names will be restored on decryption."
-J -> Encrypt to Self-Decrypting Files. Does not automatically wipes originals.
-w -> Wipe. Depends on -V n for how many wipe passes. Asks for confirmation before starting.
-s -> Same as -w but no confirmation.
-V n ->
"Sets the global persistent default number of wipe passes when overwriting, 1-7.
Default if not set is 1. The full set of 7 passes will overwrite in the following
sequence: random, ones, zeroes, random, zeroes, ones, random. Thus, -V 3 corresponds
to the DoD 5220.22-M standard for sanitizing data on fixed hard disks."
*/
"_Initialize"
Perm $P_AxCrypt = "<xydata>\Scripts\AX(Y)Crypt\AxCrypt.exe"; // Path to AxCrypt.exe
Perm $P_Messenger = "<xydata>\Scripts\AX(Y)Crypt\AX(Y)Crypt_Hermes.exe"; // Path to AX(Y)Crypt_Hermes.exe
$INI =<<<INI
[Settings]
;0 - Don't Randomize Encrypted File Names.
;1 - Randomize Encrypted File Names.
;Names will be restored upon decryption.
;Default is 0
RandomizeNames=0
;0 - Encrypt to .axx File
;1 - Encrypt to Self-Extractable File. Does not require AxCrypt
;to decrypt file on computers that does not have AX(Y)Crypt or
;AxCrypt installed.
;Default is 0
SelfExtractable=0
;0 - Automatically wipe the originals on encrypt and decrypt.
;1 - encryption and decryption retain originals.
;Default is 0
RetainOriginals=0
;How many passes to wipe file. 3 passes meets the DoD
;5220.22-M standard for sanitizing data on fixed hard disks.
;7 passes will overwrite in the following sequence:
;random, ones, zeroes, random, zeroes, ones, random.
;Default is 3
WipePasses=3
;Same as WipePasses but for File Wiping on demand.
;Default is 3
WipePassesDemand=3
;0 - Keep AxCrypt running. Allows the usage of cached keyphrase
;to make encrypting and decrypting sessions easier and more
;convenient. However you must always remember to "Quit" every
;time. Otherwise AxCrypt.exe will continue to run.
;1 - Clear cache and quit everytime the script finishes.
;Default is 0
AlwaysQuit=0
INI;
If Exists("<xydata>\Scripts\AX(Y)Crypt.ini") == 0 {
WriteFile("<xydata>\Scripts\AX(Y)Crypt.ini", "$INI");}
Global $G_RandomizeNames = GetKey("RandomizeNames", "Settings", "<xydata>\Scripts\AX(Y)Crypt.ini");
Global $G_SelfExtractable = GetKey("SelfExtractable", "Settings", "<xydata>\Scripts\AX(Y)Crypt.ini");
Global $G_RetainOriginals = GetKey("RetainOriginals", "Settings", "<xydata>\Scripts\AX(Y)Crypt.ini");
Global $G_WipePasses = GetKey("WipePasses", "Settings", "<xydata>\Scripts\AX(Y)Crypt.ini");
Global $G_WipePassesDemand = GetKey("WipePassesDemand", "Settings", "<xydata>\Scripts\AX(Y)Crypt.ini");
Global $G_AlwaysQuit = GetKey("AlwaysQuit", "Settings", "<xydata>\Scripts\AX(Y)Crypt.ini");
If $G_SelfExtractable == 1 {
$SE = "-J"; }
ElseIf $G_SelfExtractable == 0 {
$SE = "-z"; }
If $G_RetainOriginals == 1 {
$RO = "-c "; }
ElseIf $G_RetainOriginals == 0 {
$RO = ""; }
Global $G_Setup = "-V $G_WipePasses -b 2 -e -a";
Global $G_EncryptP = "-b 2 $RO-g -m $SE"; // To Encrypt to Self-Extractable, Change -z to -J (Uppcase).
Global $G_DecryptP = "-b 2 $RO-m -d";
"_Terminate"
Global $G_AlwaysQuit;
If $G_AlwaysQuit == 1 {
Run """$P_AxCrypt"" -t -x",,2,0; }
Unset $P_AxCrypt, $P_Messenger;
/* If AlwaysQuit option is turned on, AxCrypt.exe will always clear its cache
and then quit when the script finishes. */
// Functions
"Encrypt File(s) / Folder(s)|<xydata>\Scripts\AX(Y)Crypt\AxCrypt.exe : Encrypt"
Sub "_PFAInitialize";
End ("<selitems>"==""),"Nothing Is Selected!";
Global $G_RandomizeNames, $G_SelfExtractable, $G_RetainOriginals, $G_WipePasses, $Files;
Global $G_Setup, $G_EncryptP;
Run """$P_AxCrypt"" $G_Setup",,2,0;
$SelectedItems = Get("SelectedItemsPathNames","|");
If $G_SelfExtractable == 1 && $G_RetainOriginals == 0 {
ForEach($Item,$SelectedItems,"|") {
If Exists($Item) == 1 {
$Files = "$Item"."|"."$Files"; }
ElseIf Exists($Item) == 2 {
$FFiles = FolderReport("files","r",$Item,"r",,"|");
$Files = "$FFiles"."|"."$Files"; } } }
$Files = FormatList("$Files","e");
ForEach($Item,$SelectedItems,"|") {
$FileOrFolder = (Exists($Item) == 2) ? "$Item\*.*" : $Item;
Run """$P_AxCrypt"" $G_EncryptP ""$FileOrFolder""",,2,0;
If ($G_RandomizeNames == 1) {Run """$P_AxCrypt"" -m -h *.axx",,2,0} }
If $G_SelfExtractable == 1 && $G_RetainOriginals == 0 {
ForEach($Item,$Files,"|") {
Run """$P_AxCrypt"" -V $G_WipePasses -s ""$Item""",,2,0; } }
Msg "Encryption Finished.";
Sub "_PFATerminate";
"Decrypt File(s) / Folder(s)|<xydata>\Scripts\AX(Y)Crypt\AxCrypt.exe : Decrypt"
Sub "_PFAInitialize";
End ("<selitems>"==""),"Nothing Is Selected!";
Global $G_Setup, $G_DecryptP;
Run """$P_AxCrypt"" $G_Setup",,2,0;
$SelectedItems = Get("SelectedItemsPathNames","|");
ForEach($Item,$SelectedItems,"|") {
$FileOrFolder = (Exists($Item) == 2) ? "$Item\*.*" : $Item;
Run """$P_AxCrypt"" $G_DecryptP ""$FileOrFolder""",,2,0; }
Msg "Decryption Finished.";
Sub "_PFATerminate";
"Open AxCrypt File(s)|:openwith : Open"
Sub "_PFAInitialize";
End ("<selitems>"==""),"Nothing Is Selected!";
Run """$P_AxCrypt"" -V 3 -b 2",,2,0;
$SelectedItems = get("SelectedItemsPathNames","|");
ForEach($Item,$SelectedItems,"|") {
Run """$P_AxCrypt"" -O ""$P_Messenger"" ""$Item""",,2,0; }
Sub "_PFATerminate";
/* "Open the given file(s) with the appropriate application after temporary
decryption and decompression. If they are modified after application exit,
they are re-encrypted with the same pass phrase."
You Can only open 1 file at a time so you must close each file when
you're done before the next file will open. */
"Wipe File(s) / Folder(s)|:wipe"
End ("<selitems>"==""),"Nothing Is Selected!";
$WipeConfirm = Confirm("This Process Is Irreversible. Are You Sure?");
End ($WipeConfirm == 0), "Wipe Cancelled.";
Global $G_WipePassesDemand;
$SelectedItems = Get("SelectedItemsPathNames","|");
ForEach($Item,$SelectedItems,"|") {
$FileOrFolder = (Exists($Item) == 2) ? "$Item\*.*" : $Item;
Run """$P_AxCrypt"" -V $G_WipePassesDemand -s ""$FileOrFolder""",,2,0; }
ForEach($Item,$SelectedItems,"|") {
If Exists($Item) == 2 {delete 0, 0, "$Item";} }
Msg "Wipe Finished.";
" "
"Edit Configuration|:conf"
Open "<xydata>\Scripts\AX(Y)Crypt.ini";
"Quit|:del"
$Quit = Confirm("Are You Sure You Want To Quit?");
End ($Quit == 0), "";
Run """$P_AxCrypt"" -t -x",,2,0;
Unset $P_AxCrypt, $P_Messenger;
/* This is needed for PFA because if PFA is used, AxCrypt.exe will continue
to run in memory with cached keyphrase. Use this to make sure AxCrypt's
cache is empty and then quit. */
"_PFAInitialize"
If IsSet($P_AxCrypt) ==0 && IsSet($P_Messenger) == 0 {
Msg "Initial";
Global $PFARUN = 1;
Sub "_Initialize"; }
"_PFATerminate"
Global $PFARUN;
If $PFARUN == 1 {
Sub "_Terminate"; }
Code: Select all
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=Original Source By Marco (XYPlorer Messenger): http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=9216
#AutoIt3Wrapper_Res_Description=AX(Y)Crypt Hermes
#AutoIt3Wrapper_Res_Language=1033
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Original Source By Marco (XYPlorer Messenger): http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=9216
; Slightly Modified For Use With AX(Y)Crypt By Enternal
$Script = "::open "&"'"&$CmdLineRaw&"'"
$WM_COPYDATA = 0x004A
$hWnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
$dwData = 0x00400001
$iSize = StringLen($Script)
$pMem = DllStructCreate("wchar[" & $iSize & "]")
DllStructSetData($pMem, 1, $Script)
$pCds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pCds, 1, $dwData)
DllStructSetData($pCds, 2, ($iSize * 2))
DllStructSetData($pCds, 3, DllStructGetPtr($pMem))
DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hWnd, "uint", $WM_COPYDATA, "wparam", 0, "lparam", DllStructGetPtr($pCds))
XYplorer Beta Club