anchor.diff:      keyTextArea.value = '';
       try {
         if (type == CIPHER_OTP) {
  -        if (inputTextArea.value.length != 0) cipher
  -            .generateKey(inputTextArea.value.length);
  -        else cipher.generateKey(outputTextArea.value.length);
  +        String str;
  +        if (inputTextArea.value.length != 0) str = inputTextArea.value;
  +        else str = outputTextArea.value;
  +        int len = getBytesFromString(str, inputEncode).length;
  +        cipher.generateKey(len);
         } else cipher.generateKey();
  -      if (keyEncode[0] == ENCODING_HEX) keyTextArea.value =
  -          bytesToHexString(cipher.key);
  -      else if (keyEncode[0] == ENCODING_LATIN1) keyTextArea.value =
  -          bytesToString(cipher.key);
  -      else if (keyEncode[0] == ENCODING_BASE64) keyTextArea.value =
  -          bytesToBase64String(cipher.key);
  +      keyTextArea.value = getStringFromBytes(cipher.key, keyEncode);
       } catch (exception, stackTrace) {
         toast(exception.toString().replaceAll(new RegExp('Exception: '), ''));
         print(exception);
  
positive.code:     inputTextArea.value = '';
      try {
        checkKey(keyTextArea.value, initVectorTextArea.value);
        List list = null;
        if (outputEncode[0] == ENCODING_HEX) list =
            cipher.decrypt(hexStringToBytes(outputTextArea.value), mode: mode);
        else if (outputEncode[0] == ENCODING_LATIN1) list =
            cipher.decrypt(stringToBytes(outputTextArea.value), mode: mode);
        else if (outputEncode[0] == ENCODING_BASE64) list =
            cipher.decrypt(base64StringToBytes(outputTextArea.value), mode: mode);
        if (list == null) throw new Exception('Incorrect Initial Vector!');
        if (inputEncode[0] == ENCODING_HEX) inputTextArea.value =
            bytesToHexString(list);
        else if (inputEncode[0] == ENCODING_LATIN1) inputTextArea.value =
            bytesToString(list);
        else if (inputEncode[0] == ENCODING_BASE64) inputTextArea.value =
            bytesToBase64String(list);
      } catch (exception, stackTrace) {
        toast(exception.toString().replaceAll(new RegExp('Exception: '), ''));
        print(exception);
  
negative.code:     try {
        cipher.generateKey();
        if (type == CIPHER_CAESAR) cipher.key_A = 0x01;
        keyTextAreaA.value = getStringFromBytes([cipher.key_A], keyEncode);
        keyTextAreaB.value = getStringFromBytes([cipher.key_B], keyEncode);
      } catch (exception, stackTrace) {
        toast(exception.toString().replaceAll(new RegExp('Exception: '), ''));
        print(exception);
        throw new Exception(stackTrace);
      }
    });
  
  