/****************************************************** Find and retrieve the encryption key automatically Note: This is a draft version, please help to modify, Thanks! ******************************************************/ function keyFinder (str) { // str is used to get the input of encrypted string const wordBank = [ 'I ', 'You ', 'We ', 'They ', 'He ', 'She ', 'It ', ' the ', 'The ', ' of ', ' is ', 'Is ', ' am ', 'Am ', ' are ', 'Are ', ' have ', 'Have ', ' has ', 'Has ', ' may ', 'May ', ' be ', 'Be '] // let wordbankelementCounter = 0; // let key = 0; // return zero means the key can not be found const inStr = str.toString() // convert the input to String let outStr = '' // store the output value let outStrElement = '' // temporary store the word inside the outStr, it is used for comparison for (let k = 0; k < 26; k++) { // try the number of key shifted, the sum of character from a-z or A-Z is 26 outStr = caesarCipherEncodeAndDecodeEngine(inStr, k) // use the encryption engine to decrypt the input string // loop through the whole input string for (let s = 0; s < outStr.length; s++) { for (let i = 0; i < wordBank.length; i++) { // initialize the outStrElement wh