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:     {String type: "Input", bool changeValue: true}) {
    if (field == null) throw new ArgumentError.notNull('field');
  
    querySelector("#latin1$type")?.onClick?.listen((e) {
      try {
        if (encode[0] == ENCODING_HEX) field.value =
            LATIN1.decode(hexStringToBytes(field.value));
        if (encode[0] == ENCODING_BASE64) field.value =
            LATIN1.decode(base64StringToBytes(field.value));
        if (encode[0] == ENCODING_UTF8) field.value =
            LATIN1.decode(UTF8.encode(field.value));
        if (encode[0] == ENCODING_ASCII) field.value =
            LATIN1.decode(ASCII.encode(field.value));
        changeValue ? encode[0] = ENCODING_LATIN1 : encode[0] = encode[0];
      } catch (e) {
        toast("Cannot convert to LATIN1!");
        if (encode[0] == ENCODING_UTF8) querySelector("#utf8$type").click();
        if (encode[0] == ENCODING_HEX) querySelector("#hextext$type").click();
        if (encode[0] == ENCODING_BASE64) querySelector("#base64$type").click();
        if (encode[0] == ENCODING_ASCII) querySelector("#ascii$type").click();
        querySelector("#latin1$type").blur();
      }
    });
    querySelector("#hextext$type")?.onClick?.listen((e) {
      try {
        if (encode[0] == ENCODING_LATIN1) field.value =
            bytesToHexString(LATIN1.encode(field.value));
        if (encode[0] == ENCODING_BASE64) field.value =
            bytesToHexString(base64StringToBytes(field.value));
        if (encode[0] == ENCODING_UTF8) field.value =
            bytesToHexString(UTF8.encode(field.value));
        if (encode[0] == ENCODING_ASCII) field.value =
            bytesToHexString(ASCII.encode(field.value));
        changeValue ? encode[0] = ENCODING_HEX : encode[0] = encode[0];
      } catch (e) {
        toast("Cannot convert to Hex!");
        if (encode[0] == ENCODING_LATIN1) querySelector("#latin1$type")?.click();
        if (encode[0] == ENCODING_UTF8) querySelector("#utf8$type").click();
        if (encode[0] == ENCODING_BASE64) querySelector("#base64$type").click();
        if (encode[0] == ENCODING_ASCII) querySelector("#ascii$type").click();
        querySelector("#hextext$type").blur();
      }
    });
    querySelector("#base64$type")?.onClick?.listen((e) {
      try {
        if (encode[0] == ENCODING_LATIN1) field.value =
            bytesToBase64String(LATIN1.encode(field.value));
        if (encode[0] == ENCODING_HEX) field.value =
            bytesToBase64String(hexStringToBytes(field.value));
        if (encode[0] == ENCODING_UTF8) field.value =
            bytesToBase64String(UTF8.encode(field.value));
        if (encode[0] == ENCODING_ASCII) field.value =
            bytesToBase64String(ASCII.encode(field.value));
        changeValue ? encode[0] = ENCODING_BASE64 : encode[0] = encode[0];
      } catch (e) {
        toast("Cannot convert to Base64!");
        if (encode[0] == ENCODING_LATIN1) querySelector("#latin1$type").click();
        if (encode[0] == ENCODING_HEX) querySelector("#hextext$type").click();
        if (encode[0] == ENCODING_UTF8) querySelector("#utf8$type").click();
        if (encode[0] == ENCODING_ASCII) querySelector("#ascii$type").click();
        querySelector("#base64$type").blur();
      }
    });
    querySelector("#utf8$type")?.onClick?.listen((e) {
      try {
        if (encode[0] == ENCODING_LATIN1) field.value =
            UTF8.decode(LATIN1.encode(field.value));
        if (encode[0] == ENCODING_HEX) field.value =
            UTF8.decode(hexStringToBytes(field.value));
        if (encode[0] == ENCODING_BASE64) field.value =
            UTF8.decode(base64StringToBytes(field.value));
        if (encode[0] == ENCODING_ASCII) field.value =
            UTF8.decode(ASCII.encode(field.value));
        changeValue ? encode[0] = ENCODING_UTF8 : encode[0] = encode[0];
      } catch (e) {
        toast("Cannot convert to UTF-8!");
        if (encode[0] == ENCODING_LATIN1) querySelector("#latin1$type").click();
        if (encode[0] == ENCODING_HEX) querySelector("#hextext$type").click();
        if (encode[0] == ENCODING_BASE64) querySelector("#base64$type").click();
        if (encode[0] == ENCODING_ASCII) querySelector("#ascii$type").click();
        querySelector("#utf8$type").blur();
      }
    });
    querySelector("#ascii$type")?.onClick?.listen((e) {
      try {
        if (encode[0] == ENCODING_LATIN1) field.value =
            ASCII.decode(LATIN1.encode(field.value));
        if (encode[0] == ENCODING_HEX) field.value =
            ASCII.decode(hexStringToBytes(field.value));
        if (encode[0] == ENCODING_UTF8) field.value =
            ASCII.decode(UTF8.encode(field.value));
        if (encode[0] == ENCODING_BASE64) field.value =
            ASCII.decode(base64StringToBytes(field.value));
        changeValue ? encode[0] = ENCODING_ASCII : encode[0] = encode[0];
      } catch (e) {
        toast("Cannot convert to ASCII!");
        if (encode[0] == ENCODING_LATIN1) querySelector("#latin1$type").click();
        if (encode[0] == ENCODING_HEX) querySelector("#hextext$type").click();
        if (encode[0] == ENCODING_BASE64) querySelector("#base64$type").click();
        if (encode[0] == ENCODING_UTF8) querySelector("#utf8$type").click();
        querySelector("#ascii$type").blur();
      }
    });
  }
  
  class MyUriPolicy implements UriPolicy {
  
negative.code:     inputTextArea.value = '';
      try {
        checkKey(keyTextArea.value, initVectorTextArea.value);
        List list = cipher.decrypt(
            getBytesFromString(outputTextArea.value, outputEncode),
            mode: mode);
        if (list == null) throw new Exception('Incorrect Initial Vector!');
        inputTextArea.value = getStringFromBytes(list, inputEncode);
      } catch (exception, stackTrace) {
        toast(exception.toString().replaceAll(new RegExp('Exception: '), ''));
        print(exception);
  