Windows Cryptor - completed w/source

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: Windows Cryptor - wip

Post by Vera »

Hello netmaetro,

I love your about-box :) and the task list has become much better to read.

Sorry, to disturb your peace, but I found something unwanted. You can't decrypt files if the full original path is not provided anymore.
You may move the crypted files somewhere else and decrypt them. If the old path still exists they will be moved to that old place. If the old path is gone or changed the decryption fails without a hint why, nor does your programm rebuild the path by itself.

regards ~ Vera

ps: I just see that you've edited your last posting so I didn't have the 'very' last edition, but I guess the discribed circumstance has not coincidentally changed.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Windows Cryptor - wip

Post by netmaestro »

Vera, excellent observation! You know I never thought of that :oops: but the whole reason a lot of people encrypt is so their files are safe in travel. You can't expect the same path structure to exist at the destination and you can't rebuild it if the drive doesn't exist. I don't think it should be too hard to fix, perhaps store just the filepart of the full path in the encryption and then use GetCurrentDirectory()+filepart to create the restored file. Thanks for helping me with that, that's a serious bug that I wasn't going to notice anytime soon. :mrgreen:
BERESHEIT
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Windows Cryptor - wip

Post by infratec »

Hi netmaestro,

one other thing:

Why you don't compress the files additionally?
Because they grow a bit with your encryption.
(a small text file from 1546 to 4371 bytes)
I think since no one can do something with the encryted files,
you can also compress them after or before encryption.

Best regards,

Bernd

Ok, it is only a small fixed number of bytes of growing :D
But still it would be nice if you compress the files.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Windows Cryptor - wip

Post by infratec »

Hi netmaestro,

it's again me.
Why you show always 'Hide' and 'Show' in the menue?
Only one of them is possible. So why you dont replace the text
and check the text, or check your internal flag.
This makes it easier for the user.
Less is more :mrgreen:

Bernd
Last edited by infratec on Sat Aug 14, 2010 1:07 pm, edited 1 time in total.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Windows Cryptor - wip

Post by infratec »

An annoying question:

is it so unsafe to use, for example, 7-Zip with a password?
It uses also a
Strong AES-256 encryption
when you use a password.

And so I don't need a memory stick for the key, I can use my brain memory for the password.

So what was your intention?
To make it easier for the user?

Best regards,

Bernd

P.S.: I like your program, no question.
Even when I don't want to use it.
It's a nice piece of software :!:
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Windows Cryptor - wip

Post by c4s »

Nice program, but there seem to be some errors and I also have some ideas:
- Should the "active key character" on the window be transparent?
- Add an option to always hide the task list
- When I encrypt a file with key A and want to decrypt it using B a message appears that A is needed. But When I create another A key that is different from the previous A key I get this message:
"Unable to create output file 843f89j4tj340b0m45b"
- A pause option would be useful
- Double-click on tray icon should open the window as well
- Show/Hide and Create/Remove keyfile should be merged
- Option to toggle always on top (especially for the task window)
- Minimize task window
- When chosing a save path for the keyfile the main window + tasklist can't be moved, could be annoying when those windows are over the path selector

;)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Re: Windows Cryptor - wip

Post by cas »

Very nice app 8) . One thing i noticed is that there is ListIcon resize problem in Task List, it resizes beyond window border.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Windows Cryptor - wip

Post by netmaestro »

New update today! Changes include:

- Bug fixed: Files now can be decrypted anywhere (thanks vera)
- Bug fixed: Program can now recognize a wrong key with the right ID (thanks c4s)
- Bug fixed: Tasklist window resizes properly (thanks cas)

Improvements:

- Key installation is more visual
- An option to include subfolders is available on the menu. If checked, a dropped folder and all subfolder contents will be processed
- original files get seven passes of zerobytes instead of one before deletion

Latest version is uploaded, get it at the link in first post.
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Windows Cryptor - wip

Post by netmaestro »

Fixed another bug which caused problems when encountering a zero-length file. Handles these properly now.
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Windows Cryptor - wip

Post by netmaestro »

Sorry one more quick thing: The CRC32 fingerprint of a group of bytes somewhere in the middle of the IV is stored and checked on decryption now, this is to identify a wrong key that has the right ID. This means any .enc files made with the previous version won't decrypt with this one as it will complain that the key is wrong (even if it's right). So best to decrypt or delete all your .enc files before trying this (hopefully last) version.

Now I really am going to move on to something else :mrgreen:
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Windows Cryptor - completed

Post by netmaestro »

Source is listed in the first post
Last edited by netmaestro on Mon Sep 19, 2016 11:55 pm, edited 2 times in total.
BERESHEIT
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Re: Windows Cryptor - completed w/source

Post by flaith »

:D Thanks a lot Lloyd, you deserve a little dance Image :mrgreen:
“Fear is a reaction. Courage is a decision.” - WC
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Windows Cryptor - completed w/source

Post by infratec »

Hi netmaestro,

here are my poor 'optimizations':

1. Combined Hide/Show

replace

Code: Select all

Select EventMenu
        Case 1
          HideWindow(0,0)
         
        Case 2
          HideWindow(0,1)
with

Code: Select all

      Select EventMenu
;        Case 1
;           HideWindow(0,0)
         
        Case 2
          ;          HideWindow(0,1)
          If GetMenuItemText(0, 2) = "Hide"
            HideWindow(0,1)
            SetMenuItemText(0, 2, "Show")
          Else
            HideWindow(0,0)
            SetMenuItemText(0, 2, "Hide")
          EndIf
replace

Code: Select all

CreatePopupMenu(0)
MenuItem(1, "Show")
MenuItem(2, "Hide")
with

Code: Select all

CreatePopupMenu(0)
;MenuItem(1, "Show")
MenuItem(2, "Hide")
2. Allow only 'Show Task List' if not already active

replace

Code: Select all

        Case 5
          HideWindow(2,0)
with

Code: Select all

        Case 5
          HideWindow(2,0)
          DisableMenuItem(0, 5, 1)
replace

Code: Select all

Case #PB_Event_CloseWindow
      HideWindow(2,1)
with

Code: Select all

Case #PB_Event_CloseWindow
      HideWindow(2,1)
      DisableMenuItem(0, 5, 0)
replace

Code: Select all

c$ = EventDropFiles()
          HideWindow(#Window_Tasklist,0)
          If FileSize(c$) = -2
with

Code: Select all

c$ = EventDropFiles()
          HideWindow(#Window_Tasklist,0)
          DisableMenuItem(0, #MenuItem_ShowTasklist, 1)
          If FileSize(c$) = -2
and replace

Code: Select all

HideWindow(#Window_Tasklist,0)
        WriteLog("Too busy to install key, try again later",3)
with

Code: Select all

HideWindow(#Window_Tasklist,0)
        DisableMenuItem(0, 5, 1)
        WriteLog("Too busy to install key, try again later",3)
3. Allow only 'Remove Key' if one is installed

replace

Code: Select all

MenuItem(4, "Remove Key")
MenuItem(5, "Show Task List")
with

Code: Select all

MenuItem(4, "Remove Key")
DisableMenuItem(0, 4, 1)
MenuItem(5, "Show Task List")
replace

Code: Select all

keyinstalled = #True
  currentbase = *baseimage
with

Code: Select all

keyinstalled = #True
  DisableMenuItem(0, 4, 0)
  currentbase = *baseimage
and at least replace

Code: Select all

Case 4
          FillMemory(*keydata, SizeOf(KEYSTRUCT), 0, #PB_Byte)
          keyinstalled=0
          currentbase=*baseimage_d
          RenderBar(0)
with

Code: Select all

Case 4
          FillMemory(*keydata, SizeOf(KEYSTRUCT), 0, #PB_Byte)
          keyinstalled=0
          currentbase=*baseimage_d
          RenderBar(0)
          DisableMenuItem(0, 4, 1)
If it works :oops: , it would be nice if you will use this modifications in future releases. :D

Best regards,

Bernd

P.S.: If you use enumerated constants for menu items, gadgets and so on,
it is much easier to read and find some locations and it is easier to change something.
Yes, it makes a bit more work, but after all you need less time for programming and maintaining the whole program.
Even for 'small' tools this makes sense.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Windows Cryptor - completed w/source

Post by netmaestro »

Fixed a couple bugs relating to read-only files, they weren't being processed properly before. Code and exe DL are updated.
BERESHEIT
User avatar
loadstone
User
User
Posts: 97
Joined: Wed Jan 16, 2008 11:28 am
Location: china

Re: Windows Cryptor - completed w/source

Post by loadstone »

Very nice ,thanks :) :D
Diamond Sutra: all law I was into at, forbearance .
http://www.8do8.com
Post Reply