Windows Cryptor - completed w/source
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
Program is updated today. It's called Cryptor2, as it's alpha 2 now.
Changes include:
- Window is quite a bit smaller
- Window edges are antialiased and blended now, looks much better
- Operation is via Systray icon
- Program verifies .enc files are really created by Cryptor
- Program saves checksum on encryption and tests decryption output, reports success or not. (always success so far touch wood)
- Program makes sure it's not already working on a file before accepting a filedrop
- OpenFile is changed to ReadFile for the inputs to Encode and Decode procedures, to allow encrypting read-only files. (thx luis)
Download link is the new version.
Changes include:
- Window is quite a bit smaller
- Window edges are antialiased and blended now, looks much better
- Operation is via Systray icon
- Program verifies .enc files are really created by Cryptor
- Program saves checksum on encryption and tests decryption output, reports success or not. (always success so far touch wood)
- Program makes sure it's not already working on a file before accepting a filedrop
- OpenFile is changed to ReadFile for the inputs to Encode and Decode procedures, to allow encrypting read-only files. (thx luis)
Download link is the new version.
BERESHEIT
- Arctic Fox
- Enthusiast
- Posts: 609
- Joined: Sun Dec 21, 2008 5:02 pm
- Location: Aarhus, Denmark
Re: Windows Cryptor - wip
It looks great! 
Some suggestions:
- merge 'Show' and 'Hide' in the systray popup menu into a single menu item and change the item text according to the function (or use a check mark)
- check if the files, which the app will create, already exists (so it won't overwrite them)

Some suggestions:
- merge 'Show' and 'Hide' in the systray popup menu into a single menu item and change the item text according to the function (or use a check mark)
- check if the files, which the app will create, already exists (so it won't overwrite them)

Re: Windows Cryptor - wip
Nice one NM
I wish I have the code but.....
Suggestions :
- Make it one instance.
I wish I have the code but.....
Suggestions :
- Make it one instance.
Egypt my love
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
Nothing mysterious about it, the streaming threads are straight out of T&T and the only other item of any interest at all is the progress bar. For that you just take a ProgressBarGadget and bend it around your window (more or less). Seriously though, if there's interest in how it works I don't mind posting the method.I wish I have the code but.....
BERESHEIT
- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
Re: Windows Cryptor - wip
Nice 
maybe you also can add to your todo list a simple right click on a file and inside the popup menu an item with
Cryptor
+-> Crypt
+-> Crypt and send to mail
+-> Decrypt
+-> ...
just an idea

maybe you also can add to your todo list a simple right click on a file and inside the popup menu an item with
Cryptor
+-> Crypt
+-> Crypt and send to mail
+-> Decrypt
+-> ...
just an idea

“Fear is a reaction. Courage is a decision.” - WC
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Windows Cryptor - wip
Nice, Simple, Discreet, Efficient, Class.....all NETMAESTRO what 
Thanks

Thanks


Not a destination
Re: Windows Cryptor - wip
Hi netmaestro,
thanks for sharing your crytor - this small efficient tool is handy to have
As for your second version, the smaller safe is more pleasing and the grey background is gone for good.
I've en- and decoded the same files crosswise several times and they all come out indentical by verifying their checksums.
But I also noticed there is no overwriteprotection (in case this is wanted).
As ordinary user I'd like to say this:
- I'd prefer the app to show off right away if I call it and not like be forced to move and click two more times until it's available
Tip: could you supply a '/show' startup parameter (to start via link or command)
- I wouldn't fancy an app that can't be used noiselessly. Could you suppress the WIN alarmsound, (or is it desperately needed ?)
Besides I think the success-message is kind of obsolete as the 'wonderful' progressbar implies a success and maybe only supply a message on errors.
- Like flaith I would appreciate a transfer of files directly PLUS an opportunity of a silent mode, so the cryptor opens hidden and closes after the process. This could be realised with another startparameter ('/silent').
- For the open application it's possible at the moment to exit it via 'Alt+F4'. Here I would enable to minimize the app via ESC as well.
- I only once came across an app appearing similar like yours, where you only drop files on the display to have them converted (ico <-> png). I mention this because it allows to choose a custom picture to be displayed alternativ to the implemented one. Maybe it's not to difficult to load an extern image if it's placed within crytors folder, having a certain name and the needed quality. (but of course not replacing the fine progressbar
)
these are only meant as hints - but maybe you like the one or other idea
regards ~ Vera
thanks for sharing your crytor - this small efficient tool is handy to have

As for your second version, the smaller safe is more pleasing and the grey background is gone for good.
I've en- and decoded the same files crosswise several times and they all come out indentical by verifying their checksums.
But I also noticed there is no overwriteprotection (in case this is wanted).
As ordinary user I'd like to say this:
- I'd prefer the app to show off right away if I call it and not like be forced to move and click two more times until it's available
Tip: could you supply a '/show' startup parameter (to start via link or command)
- I wouldn't fancy an app that can't be used noiselessly. Could you suppress the WIN alarmsound, (or is it desperately needed ?)
Besides I think the success-message is kind of obsolete as the 'wonderful' progressbar implies a success and maybe only supply a message on errors.
- Like flaith I would appreciate a transfer of files directly PLUS an opportunity of a silent mode, so the cryptor opens hidden and closes after the process. This could be realised with another startparameter ('/silent').
- For the open application it's possible at the moment to exit it via 'Alt+F4'. Here I would enable to minimize the app via ESC as well.
- I only once came across an app appearing similar like yours, where you only drop files on the display to have them converted (ico <-> png). I mention this because it allows to choose a custom picture to be displayed alternativ to the implemented one. Maybe it's not to difficult to load an extern image if it's placed within crytors folder, having a certain name and the needed quality. (but of course not replacing the fine progressbar

these are only meant as hints - but maybe you like the one or other idea
regards ~ Vera
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
Thanks for all your suggestions! I appreciate them very much. I worked on this today, but unfortunately I didn't implement anything new. I did optimize the progress bar a great deal, taking its average render time from 3.2 milliseconds down to 0.8 milliseconds on this computer (not a very fast one) and this means that I can now update the progress bar at every 1 degree for a granularity of 360 with no speed penalty. With the previous method I had to pin the granularity back to 100 to avoid the progress bar slowing the task down. Bottom line: The previous one looked choppy when doing longer jobs and this version is much smoother. Tomorrow I'm going to try to antialias the leading edge and on the weekend I'll try to implement a lot of the suggestions. Download is updated.
BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
Significant update today, the application is taking shape.
How it works:
There are now two components to the Cryptor application, the main program and an executable key file. To use the application, you will do the following:
1) Run the program Cryptor.exe
2) Notice that the safe is disabled
3) right-click the safe or the systray icon and choose "Create Key File"
4) Select the desired Key ID from A-Z and press "Generate". A cryptrandom-quality key and vector will be generated
5) Press "Create Executable Keyfile" and choose a path
6) Close this window
7) Surf over to your created key, e.g. CryptorKey_A.exe and run it. It can be anywhere on your system, it'll find the program and install itself.
Watch the safe come to life and display the installed key on the door.
9) You're ready to go! Just remove the key when you're done and take it with you (on a USB stick or such is best)
The program will recognize the user attempting to decode a file with the wrong key. A message identifying the needed key is shown.
Play around with it, have fun! There's more enhancements coming.
Btw, the program does something odd now. It never used to do this before I switched the progress bar over to gdiplus, but now when you run it it starts out using around 1.5mb of memory. As you process a few files, it grows to around 3.2mb or so and then it levels off. I've been through the code with a microscope looking for possible leaks but there just are none. After 3.2mb you can process files all day and it won't grow, so it may be all right, dunno
Also, the file info structure has changed a bit. It's now
[Cryptor].........(string) (-20)
KEYID.............(Ascii) (-9)
CRC32............(Long) (-8)
LastchunkSize...(Long) (-4)
EOF()
I don't think it will change from here, but it means that this version won't decrypt any files you encoded with the last version. I did a computer search for *.enc and deleted all mine. Life with alpha software..
How it works:
There are now two components to the Cryptor application, the main program and an executable key file. To use the application, you will do the following:
1) Run the program Cryptor.exe
2) Notice that the safe is disabled
3) right-click the safe or the systray icon and choose "Create Key File"
4) Select the desired Key ID from A-Z and press "Generate". A cryptrandom-quality key and vector will be generated
5) Press "Create Executable Keyfile" and choose a path
6) Close this window
7) Surf over to your created key, e.g. CryptorKey_A.exe and run it. It can be anywhere on your system, it'll find the program and install itself.

9) You're ready to go! Just remove the key when you're done and take it with you (on a USB stick or such is best)
The program will recognize the user attempting to decode a file with the wrong key. A message identifying the needed key is shown.
Play around with it, have fun! There's more enhancements coming.
Btw, the program does something odd now. It never used to do this before I switched the progress bar over to gdiplus, but now when you run it it starts out using around 1.5mb of memory. As you process a few files, it grows to around 3.2mb or so and then it levels off. I've been through the code with a microscope looking for possible leaks but there just are none. After 3.2mb you can process files all day and it won't grow, so it may be all right, dunno

Also, the file info structure has changed a bit. It's now
[Cryptor].........(string) (-20)
KEYID.............(Ascii) (-9)
CRC32............(Long) (-8)
LastchunkSize...(Long) (-4)
EOF()
I don't think it will change from here, but it means that this version won't decrypt any files you encoded with the last version. I did a computer search for *.enc and deleted all mine. Life with alpha software..

BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
Another significant update today.
Remember when I said that the Cryptinfo structure probably wouldn't change? You're right, I lied. The structure now contains an encrypted (with the same key) string containing the original filename. So now, when the encrypted file is processed, the original file is restored with the original name. I decided this was a safe thing to do after encrypting/decrypting thousands of files and checking CRC32s. No errors ever.
So- If you want to test this version (alpha3) your first order of business is to delete all your .enc files now. Don't test this version until this step is completed.
New features:
- The program no longer looks at the file extension to see if it's a valid cryptfile. Instead it reads the Cryptinfo structure. This means you can call an encrypted file anything you want, such as "sigfriedmoves.topics" and it will be recognized and decrypted properly.
- The program no longer looks at the file name to recreate a "safe" decrypted file. It creates the original filename as read from the Cryptinfo structure. e.g. fredfixes.bugs crypts to --> fredfixes.bugs.enc renamed to freakcodes.libs decrypts to --> fredfixes.bugs
- The program wipes with zerobytes everything that was in the original file and deletes it. - I know, bring on the torpedoes
Really, what's this thing for anyway?
- You can now drop multiple selected files and the program will process them in an orderly manner.
- You can now drop a folder on the program and all files in the folder will be processed.
- There's a Task List window now (only up when it's working) and this is used for most messages. Almost no use of MessageRequester.
- You can abort a single file or whole task as you wish.
If you want to test the A3 version, the DL link is updated in the first post. It's best to make a copy of a folder to test with, so as not to lose any valuable files. But if your experience is anything like mine, you will encrypt/decrypt/abort/whatever the files in your test folder dozens of times and the results will be perfect.
@Fred: Some brilliant libs with this version, man. And rock-solid. I couldn't write something like this without you.
Have fun and all suggestions are welcome!
Remember when I said that the Cryptinfo structure probably wouldn't change? You're right, I lied. The structure now contains an encrypted (with the same key) string containing the original filename. So now, when the encrypted file is processed, the original file is restored with the original name. I decided this was a safe thing to do after encrypting/decrypting thousands of files and checking CRC32s. No errors ever.
So- If you want to test this version (alpha3) your first order of business is to delete all your .enc files now. Don't test this version until this step is completed.
New features:
- The program no longer looks at the file extension to see if it's a valid cryptfile. Instead it reads the Cryptinfo structure. This means you can call an encrypted file anything you want, such as "sigfriedmoves.topics" and it will be recognized and decrypted properly.
- The program no longer looks at the file name to recreate a "safe" decrypted file. It creates the original filename as read from the Cryptinfo structure. e.g. fredfixes.bugs crypts to --> fredfixes.bugs.enc renamed to freakcodes.libs decrypts to --> fredfixes.bugs
- The program wipes with zerobytes everything that was in the original file and deletes it. - I know, bring on the torpedoes

- You can now drop multiple selected files and the program will process them in an orderly manner.
- You can now drop a folder on the program and all files in the folder will be processed.
- There's a Task List window now (only up when it's working) and this is used for most messages. Almost no use of MessageRequester.
- You can abort a single file or whole task as you wish.
If you want to test the A3 version, the DL link is updated in the first post. It's best to make a copy of a folder to test with, so as not to lose any valuable files. But if your experience is anything like mine, you will encrypt/decrypt/abort/whatever the files in your test folder dozens of times and the results will be perfect.
@Fred: Some brilliant libs with this version, man. And rock-solid. I couldn't write something like this without you.
Have fun and all suggestions are welcome!
BERESHEIT
Re: Windows Cryptor - wip
Thanks for the nice comment, happy to see everything works as expected. About your software, you should really push it on regular software sites as it brings some interesting and easy functionalities ! Good work with it.
Re: Windows Cryptor - wip
hi Netmaetro
excellent programme, thanks
it would be possible to have a key from a text and returns the same key
for a new cryptorkey. to erase the computer 1er cryptorkey, for if someone enters your computer can uses your cryptorkey if you forgot or if you lose your
cryptorkey or lost after a system restore
Also maybe Be key system PGP with primary and secondary
bye
excellent programme, thanks
it would be possible to have a key from a text and returns the same key
for a new cryptorkey. to erase the computer 1er cryptorkey, for if someone enters your computer can uses your cryptorkey if you forgot or if you lose your
cryptorkey or lost after a system restore
Also maybe Be key system PGP with primary and secondary
bye
Re: Windows Cryptor - wip
Hello netmaetro,
you program seems to become more professional with each update
The multifile & folder-dropping really is handy and removing the originals is a clean improvement on first glance.
As for my personal taste I would always like to keep the originals before deleting them (so I would work with copies). Maybe one only wants to send a file to s.o. else but not loose it.
> This means you can call an encrypted file anything you want,
so you can hide them a second time and irritate all snoopers
- you can knock yourself out by cypting the used key while this key is the actual one - exit and your done
- The fixed & ontop task-list is kind of unhandy and I don't see how aborting shall work as the cryption is to fast, and the buttons don't initiate an undo.
Note: don't worry about me, I've never had any need to crypt anything, still I'd like to have the opportunity - just in case.
greetings ~ Vera
you program seems to become more professional with each update

The multifile & folder-dropping really is handy and removing the originals is a clean improvement on first glance.
As for my personal taste I would always like to keep the originals before deleting them (so I would work with copies). Maybe one only wants to send a file to s.o. else but not loose it.
> This means you can call an encrypted file anything you want,

- you can knock yourself out by cypting the used key while this key is the actual one - exit and your done

- The fixed & ontop task-list is kind of unhandy and I don't see how aborting shall work as the cryption is to fast, and the buttons don't initiate an undo.
Note: don't worry about me, I've never had any need to crypt anything, still I'd like to have the opportunity - just in case.
greetings ~ Vera
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
The task list is only there if it's wanted, the user can close it anytime. The aborts are really only there for if you accidentally do a folder that has a 4gb file in it that you didn't mean to process, or dropped the wrong folder, it gives you an easy out. You're right though, there isn't a real need to abort most files because it is so fast. A 200mb iso is encrypt/decrypting here in about 10 seconds.The fixed & ontop task-list is kind of unhandy and I don't see how aborting shall work as the cryption is to fast, and the buttons don't initiate an undo
BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Windows Cryptor - wip
Last update today:
- Added aboutbox (not a normal one of course
)
- Enforced single instance w/visual feedback and wakeup of existing instance.
- Improved task list communications, line items are color coded. Success=green, failure=red, warning=yellow.
- Task list line items are shown for work currently being done, a new line is added for result.
- Tweaked decryption, if a file of the original name exists with a different CRC32 it won't be overwritten. If same, the encrypted file gets deleted and success is reported.
- Added helpfile (could use improvements, probably I'll work on it over the next days)
Program is finished for now unless problems arise. Time to move on to something else. Maybe MS needs some help with Windows 8? Half of it's likely PB anyway
Link in first post is updated with the final.
- Added aboutbox (not a normal one of course

- Enforced single instance w/visual feedback and wakeup of existing instance.
- Improved task list communications, line items are color coded. Success=green, failure=red, warning=yellow.
- Task list line items are shown for work currently being done, a new line is added for result.
- Tweaked decryption, if a file of the original name exists with a different CRC32 it won't be overwritten. If same, the encrypted file gets deleted and success is reported.
- Added helpfile (could use improvements, probably I'll work on it over the next days)
Program is finished for now unless problems arise. Time to move on to something else. Maybe MS needs some help with Windows 8? Half of it's likely PB anyway

Link in first post is updated with the final.
BERESHEIT