Skip to content

Provides secure storage of data in the database.

Notifications You must be signed in to change notification settings

swift1719/encryptor

Repository files navigation

Encryptor

It is a Java based application that aims to ensure data security in a local computer system.

  • It uses “Cryptography using Colors and Armstrong Numbers” for encryption and decryption of data.
  • It uses three keys for encryption, which are as follows, user provided key, numeric key, and color key.
    1. Generation of numeric key from the key provided by the user.
      • The sum of ascii values of characters in key provided by user is obtained .
      • Using the above obtained sum, now we will select a permutation from the array containing all permutation of [ 1, 2, 3, 4] (as there exists 4 armstrong numbers { 153, 370, 371, 407 } )
      • Using the permutation selected from the array of permutations we will form key by selecting the armstrong numbers from array of armstrong numbers in the order they appear the selected permutation and generate a part 'A' of numeric key.
      • Final numeric key is obtained by appending the sum of ascii values(part 'B') of characters within the key provided by user.
      • Final Numeric Key = part 'A' + part 'B'
    2. Then the data is byte by byte xored with numeric key genereated in previous step.
    3. The encrypted data is further encrypted using colors.
      • Each byte of data is split-up into 4-bits each. The most significant 4-bits(higher order bits) are used to obtain row, and the least significant 4-bits(lower order bits) are used to obtain column from the color matrix.
      • The numeric key is again utilised to obtain base values of the Red, Green, and Blue color matrix.(refer the 4th image below "Obtaining color value from Color Matrix")
      • For consecutive data bytes, these three colors are selected in a consecutive manner.
      • Then using row and column value obtained above, we obtain color value at selected color matrix's [ row, col ] using base value, for each data byte and return the value obtained as the final encrypted value.
    4. Thus, we ensure double layer encryption.
  • The Decryption process follows exactly reverse mechanism to obtain back the original data.
  • The algorithm operates on Bytes and therefore it supports all file formats.

Representation

  1. Data Flow

  2. Encryption

  3. Decryption

  4. Obtaining color value from Color Matrix


Sample Output

  1. Output console

  2. Demo Files

    • Text File

      textdemo

    • Image File

      imgdemo

  3. DB console

    • Before
    • After

References

About

Provides secure storage of data in the database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages