GithubHelp home page GithubHelp logo

pgptool / pgptool Goto Github PK

View Code? Open in Web Editor NEW
130.0 9.0 29.0 1.33 MB

Java-based desktop GUI application for easy and regular PGP decryption/encryption

Home Page: https://pgptool.github.io/

License: GNU General Public License v3.0

Java 96.07% Rich Text Format 3.93%
pgp encrypter desktop desktop-application desktop-app multi-platform java

pgptool's Introduction

PGP Tool

PGP Tool is a Java-based desktop GUI application for easy PGP decryption/encryption of files and text.

It will be especially useful for those who tend to store sensitive information on their computer and sometimes sync this to Google drive, Dropbox, etc, and don't want this information to be stored in un-encrypted state.

The numerous other PGP software applications which currently exist don't seem to support this use-case in a user-friendly way, as they require the user to perform many manual operations (which is quite annoying). Software is supposed to automate things and not the other way around.

This application requires a minimal number of user actions.

Application home page:

https://pgptool.github.io/

pgptool's People

Contributors

dependabot[bot] avatar skarpushin avatar timetoseek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pgptool's Issues

New feature: export keys

HTD 1:

  • Precondition: There was at least 1 key imported before
  • Open app. Menu -> Keyring
  • Select key
  • Do right click, select "Export public key"
  • Expect: File Chooser dialog is opened
  • Expect: File Chooser dialog remembered last location (if any)
  • Expect: If I remove extension, program will add it for me (only .asc part), but only if I haven't select "All files" for files filter. In latter case it should not alter filenames
  • Click Choose
  • Expect: Only public part of the key is saved to disk
  • Expect: It's possible to delete this key from keyring and import it from disk (of course only encryption will be available)

HTD 2:

  • Same as HTD 1 except:
  • Precondition: At least 1 private key was already imported
  • In the context menu select "Export private key"

Fix: when selecting multiple files in Windows Explorer and triggering context action "Encrypt to PGP" not all Encrypt windows are appearing

How to reproduce:

  • Make sure application is not running yet
  • Open Windows File browser
  • Select 2 files
  • Click "Encrypt to PGP"
  • (error) Only 1 encryption dialog appears

Known workaround

  • Make sure application is running in a background
  • ...then perform other steps

Triage:

  • This looks like a race condition, which is similar by its nature to singleton issue in multi-threaded environment (we assigned ref of new instance to a variable, but instance itself is not initialized yet).
  • In our case bug happens because lock file is created by primary instance but monitoring is not yet started OR not ready to be handled -- TBD: Confirm which one is a case

FR-4: Configure path to temporary folder for un-encrypted files

HTD:

  • Open app
  • Open Decrypt operation window
  • For target file location there is a choice to save it to temporary folder (change check box to radios: Temp, Same, Browse)
  • Temporary folder is initialized by default as a sub-folder of pgpvault application config files (residing user home folder)
  • Menu item: Change temporary folder
  • Select other temporary folder
  • Expect: error message if temporary folder cannot be used (create and remove test file to verify that)
  • Expect: program will remember to use temp folder based on file name or file base path

Put initial source code

Eclipse project, Java
Maven
Spring
i18n
Presentation Model design pattern
Should build and run
Unit tests placeholder

New feature: Allow to create new key

HTD:

  • Open app
  • Go to Menu -> Keyring -> Create new PGP key
  • Enter user name, email, passphrase, (optional) key expiry date
  • Click "Create PGP key"
  • Expect: validation errors will appear if input provided by user is invalid
  • Expect: created key will appear in a key ring table
  • Expect: (if it's a first private key in a key ring) program will suggest user to back it up to some safe (like USB stick and put it to physical safe) place because otherwise it would be impossible to recover it
  • Expect: This key can be used to encrypt and decrypt files
  • Expect: This key can be exported and imported back again
  • Expect: This key should be compatible with other PGP programs (TBD: test with non Bouncycastle-derived implementations)

Improve: display only 1st user information when listing keys

HTD:

  • Open keyring dialog OR open Encrypt dialog
  • Expect: for each key there is only 1 user name and probably an email
  • Expect following logic: Cut everything after email's closing bracket ">". If non is found cut everything after (including) first semicolon.

Issue is that some keys have a lot information about user including org units and so forth which ends up to be a VERY long string in keys list. Not convenient to use.

Make sure window will be brought to front when asked to become visible

HTD:
Environment:

  • Windows 10

Preconditions:

  • Application is already running
  • Minimized or just not on top

Actions:

  • Open file explorer and double-click pgp file (presuming PGPVault is associated with *pgp files

Failed expectations:

  • Decryption window is not activated (it's shown in a background but this window is not focused). User have to find this window on a task bar and bgring to front manually

FR-20: Decrypt operation (trigger from menu and command line)

HTD Entry Point 1:

  • Start app
  • Menu -> Actions -> Encrypt

HTD Entry Point 2:

  • Start app from command line with file to encrypt

HTD:

  • Expect: if no keys registered -- show error message saying that keys are required for encryption process
  • Encryption dialog for single file appears
  • (in case of Entry Point 2) Expect: file path name is already there
  • Choose other file as an input
  • Multi select recipients
  • Browse for output file
  • CheckBox to delete source file after encryption
  • CheckBox to open target folder after encryption
  • Expect: if no recipients are selected then Encrypt command is disabled
  • Expect: if output is not selected then same directory and same file name + gpg extension used
  • Expect: program will remember settings based on input file (when I'll open this dialog for same input file again it should show me same processing and output parameters)
  • Expect: program will remember settings based on input folder and auto-suggest output parameters based on input folder if file is different
  • Expect: After encryption show confirmation about successful operation and close window. If checkbox OpenTargetFolder set to true then confirmation is not shown
  • Expect if suggestions are not found -- preselect all receipients that we have private ky for

Decomposition:

  • Menu action
  • RootPM code to launch Encrypt Dialog
  • Process program args and also launch Encrypt Dialog
  • Develop view (controls layout)
  • Determine settings pair DTO for input and output
  • Presenter model properties and binding
  • Browse for other input file
  • Browse for output file
  • Auto build output file name
  • Disable "Encrypt" operation if no recipients selected
  • Encryption operation itself
  • Save setting pair
  • Gracefully ignore missing recipients if keys were deleted
  • Suggest settings pair based on input file
  • Suggest settings pair based on input file's folder
  • Confirmation about operation success
  • Open folder browser for output file
  • Delete source file

New feature: Windows Installer

Goal: Create windows installer for PGP Vault application

Requirements

Outputs of this task

Add simple Windows Installer

Goal: Create windows installer for PGP Vault application

Requirements

Outputs of this task

New feature: Signature verification capability

Guidelines:

  • Maintain same level of User Experience as in the rest of the application: seamless, less user actions, error-trimmed
  • Ensure signature verification capability of PGP Tool will match the same of GnuPG (https://www.gnupg.org/) - this may result in extension/change of completion criteria list

Completion criteria:

  • It is possible to verify signature during file decryption
  • Auto-detect external signature (same file name but with .sig extension)
  • Let user choose any external file as a signature
  • Signature verification option will be remembered and suggested during subsequent decryption of same file(s)
  • If signature was done using one of our own private keys, remember it and use in "Encrypt Back [All]" feature
  • It is possible to verify signature during text decryption (let user paste signature in a window or select external file with it)
  • It is possible to verify signature of any external file (new button added into drop-down mentioned in #17 )
  • It is possible to verify signature of any text (new button added into same drop-down)

New feature: Signature creation capability

Guidelines:

  • Maintain same level of User Experience as in the rest of the application: seamless, less user actions, error-trimmed
  • Ensure sign capability of PGP Tool will match the same of GnuPG (https://www.gnupg.org/) - this may result in extension of completion criteria list

Completion criteria:

  • It is possible to sign file when encrypting
  • Let user choose which key to use for signature
  • Passphrase will be remembered (same cache will be shared with decryption window)
  • Config files will remain backwards compatible
  • Seamless key upgrade will be performed in case key does not have necessary flags and/or subkeys
  • Support "Detached signatures" option (need to research -- what is this, is it a duplicate requirement?)
  • It is possible to sign text when encrypting
  • It is possible to sign any text
  • It is possible to sign any file (new toolbar button group will be introduced - let it be dropdown)
  • "Encrypt back" will also sign with same key if signature was previously added
  • "Encrypt back" will a) show a warning in case signature was detected, but we're skipping signature and b) will delete auto-detected signature file (as it is not useful anymore)
  • "Encrypt back" will not show input for key password if it is already cached in-memory, but if user changes key, password will appear
  • "Encrypt back all" will also sign if signature was previously added
  • "Encrypt back all" will have an option to skip signature (also show same warning as above)
  • "Encrypt back all" will handle case when different keys were used to sign different files (will need multiple passwords for multiple keys)

Refs:

  • Separate sub-key which will be used for signing (ref1, ref2)

Sort keys by name

HTD 1

  • Open encryption dialog
  • Expect: all keys are displayed in sorted order by user name

HTD 2

  • Open keyring dialog
  • Expect: all keys are displayed in sorted order by user name

FR-9, FR-12: Decrypt file and save result to some folder (user browses target folder).

HTD:

  • Invoke operation either from menu or from command line
  • Expected: If no keys are registered notify user about the need to add at least one private key and open keys list (of no private keys were added close decrypt dialog)
  • Expected: Decryption dialog opened. If invoked from command line then source file is prepopulated.
  • Browse for file to decrypt
  • Expected: Program remembered what source folder we used previous time and pre-seleced it
  • Expected: combobox with keys we can use for decryption is populated OR if non found error displayed and Decrypt button is disabled
  • Enter password
  • Expected: if we already entered password during this session don't ask it again (pre-populate input with stars)
  • Expected: password is displayed as starts and it's not possible to copy it to clipboard (pasting from clipboard should be allowed)
  • Have option to decrypt to same folder
  • Have option to decrypt to other folder (file chooser)
  • Have checkbox to delete source file
  • Have checkbox to open target folder after decryption
  • Have checkbox to invoke OS-registered editor for target file once decrypted (only if it's possible to resolve file extension)
  • Expect: program will remember parameters based on source file and will suggest it next time I open this dialog and choose same input file
  • Expect program will also suggest parameters based on source folder if didn't find exact match for file
  • Expect: if no password was entered or source file doesn't exists disable Decrypt action
  • Click Decrypt
  • Expect: file decrypted and appeared at target location
  • Expect: source file is deleted (if corresponding checkbox was selected)
  • Expect: target fodler browser opened (if corresponding checkbox was selected)
  • Expect: associated application was launched (if corresponding checkbox was selected)
  • Expect: if neither of post actions selected (open folder or associated application) show confirmation about successful decryption
  • Expect: input focus should go to password field
  • if Return key pressed inside password field -- perform decryption operation (if available)
  • Expect: can decrypt: pgp, asc with and without signature
  • Write couple unit tests to test ability to decrypt files encrypted by couple other applications with different settings

FR-8: If other instance of pgpvault application is already running -- pass execution to that instance (java apps start very slow, so we need to mitigate that).

HTD Scenario 1:

  • Precondition: PGPVault app is running but no other Encrypt/Decrypt dialogs are open
  • Start 2nd instance from start menu or by double clicking on app (no command-line args)
  • Expect: 1st instance main frame will become visible

HTD Scenario 2:

  • Precondition: PGPVault app is running and at least 1 Encrypt/Decrypt dialogs are open
  • Start 2nd instance from start menu or by double clicking on app (no command-line args)
  • Expect: 1st instance main frame will become visible

HTD Scenario 3:

  • Precondition: PGPVault app is running and there is at least 1 Encrypt/Decrypt dialog currently open
  • Expect: 1st instance will create another Dialog and show it (so that this dialog is no longer model window -- we can have as many open Encrypt/Decrpyt open dialogs as needed)

[duplicate] Add simple installer for windows

Goal: Create windows installer for PGP Vault application

Requirements

Outputs of this task

FR-1: Import existing PGP certificates

HTD:

  • Start app
  • Menu -> Import certificate
  • Browse for file, confirm
  • See confirmation message about imported certificate

Decomposition:

  • UI: Menu item, Browse for certificate, Confirmation
  • KeyRing abstraction
  • Impl for certificate import
  • Impl for certificates serialization
  • Handle duplicates
  • Unit tests for read/import/load/save operations

Respect Windows DPI settings

On large screens app font stays small. It needs to be increased accordingly so that user will not need magnifying glass

FR-3: Remove PGP Key from keyring

HTD:

  • Start app
  • Menu -> Certificates
  • Expected: list of previously imported certificates displayed in table view
  • Expected: there is a button to delete a PGP key
  • Expected: It also responds to keyboard Delete button
  • Expected: table to be refreshed after I delete key
  • Expected: key is not there after program restart or window re-open
  • Expected: when last key was deleted message "no data to display" appears instead of table

Decomposition:

  • new menu item for Keys window
  • Confirmation dialog: Are you sure?
  • Delete certificate
  • Make sure table updates

Postponed:

  • Ok. What if we're removing key that was a part of key ring for temporarily decrypted file. It means we can't encrypt it back exactly same way. I think we'll need to add warning about it later.

Allow to import multiple keys at a time

HTD:

  • Open app
  • Either from Main window menu or from Key ring window click Import PGP Key
  • Select 1 or more files
  • Click choose
  • Expect: error message box will appear for all files that are cannot be imported
  • Expect: if at least 1 key can be imported show dialog with a table of keys to be imported (with columns just like in similar table in Key ring dialog)
  • Expect now 2 actions available Confirm Import or Cancel
  • IF cancel is clicked THEN dialog closes and nothing else happens
  • IF "Confirm import" was clicked THEN
    • All keys are imported
    • Failed files skipped (do not fail whole operation)
    • At the end of the import procedure message box showing summary appears. X keys imported, Y failed. And for each Y file there will be a reason why import failed

Decomposition:

  • Refactor current import key dialog - get rid of current view, it's pretty much useless. It might happen that #3 will no longer be reproducible.
  • Reuse key ring table model for list of chosen keys (or maybe reuse the whole table view, then extract it to separate component - do not over-engineer)
  • Perform batch import
  • Display operation summary

New feature: Encrypt any text content

HTD:

  • (presuming there is at least 1 public key in a key ring)
  • A; Open app
  • A: Click "Encrypt text"
  • E: Window appears with: list of recipients, 2 text areas, dialog buttons
  • A: Paste text from clipboard to left text area
  • A: Select recipients
  • A: Click "Encrypt"
  • E: Right text area is filled with encrypted (armored) text

HTD 2: if no recipients selected or source text provided, disable "Encrypt" button
HTD 3: Ctrl+C/Ctrl+V and context menu with "Copy" and "Paste" action available in both text areas at all times when dialog shown
HTD 4: There is also a convenience button "Encrypt and copy to clipboard" which copies to clipboard after encryption

FR-7: Handle program start with parameters passed (files to encrypt)

HTD:

  • Open file explorer in Windows
  • Right-click on any file
  • There is a menu item in the appeared context menu: PGP Encrypt (or alternatively Send To -> PGP Encrypt)
  • Click on this menu item
  • Expected: PGP Vault app launched, Encrypt dialog opened, Input file appears in the "Source file" input field
  • Expect: if this is first app start and there no keys imported yet then app will suggest to import keys first
  • Expect (for MVP version only) if multiple files selected then Encrypt window will appear for the 1st file only (later we'll implement handling for multiple files at a time #9 )

FR-17: Show list of temporarily decrypted files

Idea is that if file was decrypted it was decrypted temporarily. Which means it has to be encrypted back and decrypted version have to be deleted! Program should keep track of all decrypted files and show them in table allowing user to manage decrypted content and easily encrypt it back and perform other useful operations.

HTD:

  • Decrypt some files
  • Expect: All decrypted files will appear in the decryption history table (in the main window) in chronological order
  • Expect: row will automatically disappear from this table if decrypted file will disappear from disk
  • Expect: Columns: Encrypted location | Decrypted location
  • Expect: If encrypted version doesn't exists then "Encrypted location" field will be preceded with "DELETED:" prefix to make sure user notices that encrypted version is no longer exists
  • Expect: Program will keep track of these files even after restart

Not sure -- do we need it? I doubt user will want to have too many un-encrypted files at the same time. And for the few files following features seem redundant:

  • Expect: Filter by name
  • Expect: Filter by decryption status (show only those which decryption product is still decrypted)

Postpone (will be impl as a part of other feature):

  • There is a button "Encrypt all back and cleanup" (which means "Encrypt all files back and delete non-encrypted versions")
  • Expect: program will silently encrypt all files back but only for those files that don't have any problems. In case of problems application will report causes to user.

FR-11: Decrypt file and remember associated metadata (so that we’ll be able to encrypt it back without asking user too many questions)

HTD:

  • Expect: program will be able to resolve suggested encryption parameters based on previous decryption. Not only target filename and folder but also list of recipients
  • Expect: upon encryption (later, if using these remembered settings) -- warn user if not all public keys and program can't encrypt it for same recipients as it was before decryption
  • Expect In case of temporary folder was changed -- program will not loose track of files saved to previous temp folders. Newly decrypted files will be saved to new temp folder only.

FR-2: List of PGP certificates

HTD:

  • Start app
  • Menu -> Certificates
  • Expected: list of previously imported certificates displayed in table view
  • Expected: there is a button to import existing certificate
  • Expected: After I import another certificate it appears in table

Decomposition:

  • Menu item
  • Dialog window with list of certificates
  • Button to import certificate (same action as from Menu)
  • Make sure events regarding certificates key ring are broadcasted
  • Handle event about imported certificate -> update view

Create project home page

  • Looks neat / clean
  • At least in In English, would be nice to have a translated version in Russian
  • One-page site. Sections:
    ** Big font short text What, For who, Why, How + Download link
    ** Features highlight
    ** Any questions?
    ** Discovered a bug?
    ** Improvement needed?
    ** How to support? (donate button)
    ** FAQ
    ** Download options and notes on installation
    ** Advantage over competitors details
    ** Screenshots with annotations
    ** High-level on what is PGP
  • Github WiKi pages
    ** Project charter
    ** Project goals and guidelines
    ** How to write "How To Demo" scenarios
    ** Definition Of Done
    ** Branching strategy

Fix: executable file must correctly handle unicode command line arguments (launch4j issue)

Currently launch4j is not handling unicode characters in windows command line. Find out what can be done.

Workaround:

  • Change Windows codepage from English to whatever non-English language user is using

Plan:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.