Suggestion for key padding for EasyEncrypt Application

in #utopian-io6 years ago (edited)

icons8_Secure_48px.png

Repository

https://github.com/officialhord/EasyEncrypt

Components

"EasyEncrypt is a desktop offline application meant to provide encryption and decryption services to users, this is done with a key chosen by the sender which must be used by the receiver before the encrypted message can be decoded.""
-source

Proposal Description

  1. Padding of the key entered by the user .

For the easyencryption application, there exist two encryption techniques (AES and DES) which one can use and for each of them, the required key length is - 16 and 8 characters respectively which is stated explictly when a user clicks on the technique he intends to use.
If the user doesnt enter a key to the required length, an error is shown .

easyEncryptError.PNG

My suggestion will be to add a padding algorithm that will add space characters (" ") to the key inorder to make it up to the required length.

How to achieve my above suggestion

While going through the code made available by the developer - a check should be placed when the user clicks either the encrpyt or decrypt button for the entered length of the key and if it doesnt match up to the expected length, spaces should be appended to the key.

i.e

private String checkKeyLength(String key, String expectedKeyLength){
    if(key.length < expectedKeyLength){
        for(int i = key.length ; I <= expectedKeyLength ; i++){
            key+=" "; // key = key + " ";
        }
    }
    return key;
}

Benefits

The above suggestion will be beneficial to the user of the application in helping them enter a key of any length which can be easily remembered than entering a 16 character key which they can hardly remember and there is no need to encrypt if you will end up forgetting the key and loosing your information.

GitHub Account

https://github.com/generalkolo

Sort:  

Hello @edetebenezer, Thank you for contributing through Utopian.

Sorry! Your contribution cannot be reviewed because the project repository is on Utopian Blacklisted Repos

Endeavor to check to avoid similar thing in your next contribution.

Thank you!!!


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]