Status: Tags: #js Links: JavaScript MOC
JavaScript Encryption Program
Design (Back-End)
Classes
ConversionInstance
Stores some information of the current conversion
Properties
idinputconversionTypeoutput
Methods
log- Logs the instance into array for previous actions
Encryption/Decryption Methods
Have objects for the different kinds of encryptions/decryptions ex)
EnigmaorCaesarShiftRefer to Encryption Methods Implementation
Properties
toEncrypt- true if user wants encryption, false otherwise
- Appropriate values needed for performing the conversion
- Grabbed from the user input
- Variable depending on the kind of conversion
Methods
setProperties- Sets the properties of the conversion that is going to happen
- Pulls values from user input fields
encrypt- Takes
ConversionInstance - Manipulates
- Takes
decrypt
Log
Stores previous conversions
Properties
previousConversions
Methods
getConversion- Fills input fields of previous conversion
Functions
Runner function (onClick)
- Creates a new
Conversionobject - Checks whether encryption or decryption
- Switch statements to find out which encryption/decryption needs to be done
- Performs conversion
- ex) If the user wanted an
Enigmaencryption:Enigma.setProperties();ConversionInstance.setOutput( Enigma.encrypt() );
- ex) If the user wanted an
- Stores object conversion through
ConversionInstance.log(); - Program LMAO
References:
Created:: 2021-05-31 18:50 PM