decipher static method

List<int> decipher({
  1. required List<int> data,
  2. required int password,
})

Decrypts the given data using a password and security key. The bigger the security key number the safer it is but the longer it takes to compute.

Implementation

static List<int> decipher({required List<int> data,required int password}){
  //Generate private and public keys
  CipherGen generated = CipherGen(seed: password);
  //Decrypt the data
  List<int> decipheredData = [];
  for(int i = 0;i < data.length; i++){
    //Decrypt and add
    decipheredData.add(data[i].modPow(generated.d!, generated.N!));
  }
  //Return decrypted data
  return decipheredData;
}