anchor.diff:      initVectorTextArea.value = '';
       try {
         cipher.generateKey();
  -      if (keyEncode[0] == ENCODING_HEX) {
  -        keyTextArea.value = bytesToHexString(cipher.key);
  -        initVectorTextArea.value = bytesToHexString(cipher.initVector);
  -      } else if (keyEncode[0] == ENCODING_LATIN1) {
  -        keyTextArea.value = bytesToString(cipher.key);
  -        initVectorTextArea.value = bytesToString(cipher.initVector);
  -      } else if (keyEncode[0] == ENCODING_BASE64) {
  -        keyTextArea.value = bytesToBase64String(cipher.key);
  -        initVectorTextArea.value = bytesToBase64String(cipher.initVector);
  -      }
  -    } catch (e) {
  -      toast(e.toString().replaceAll(new RegExp('Exception: '), ''));
  -      throw new Exception(e);
  +      keyTextArea.value = getStringFromBytes(cipher.key, keyEncode);
  +      initVectorTextArea.value =
  +          getStringFromBytes(cipher.initVector, keyEncode);
  +    } catch (exception, stackTrace) {
  +      toast(exception.toString().replaceAll(new RegExp('Exception: '), ''));
  +      print(exception);
  +      throw new Exception(stackTrace);
       }
     });
   
     void checkKey(String key, String iv) {
       try {
         if (key == null) throw new Exception("Key is empty!");
  -      if (keyEncode[0] == ENCODING_HEX) {
  -        cipher.key = hexStringToBytes(key);
  -        cipher.initVector = hexStringToBytes(iv);
  -      } else if (keyEncode[0] == ENCODING_LATIN1) {
  -        cipher.key = stringToBytes(key);
  -        cipher.initVector = stringToBytes(iv);
  -      } else if (keyEncode[0] == ENCODING_BASE64) {
  -        cipher.key = base64StringToBytes(key);
  -        cipher.initVector = base64StringToBytes(iv);
  -      }
  +      cipher.key = getBytesFromString(key, keyEncode);
  +      cipher.initVector = getBytesFromString(iv, keyEncode);
       } catch (exception, stackTrace) {
         toast(exception.toString().replaceAll(new RegExp('Exception: '), ''));
         print(exception);
  
positive.code:     try {
        checkKey(keyTextAreaA.value, keyNumber: 1);
        checkKey(keyTextAreaB.value, keyNumber: 2);
        List list = null;
        if (outputEncode[0] == ENCODING_HEX) list =
            cipher.decrypt(hexStringToBytes(outputTextArea.value));
        else if (outputEncode[0] == ENCODING_LATIN1) list =
            cipher.decrypt(stringToBytes(outputTextArea.value));
        else if (outputEncode[0] == ENCODING_BASE64) list =
            cipher.decrypt(base64StringToBytes(outputTextArea.value));
        if (list == null) throw new Exception('Incorrect message encoding!');
        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 (e) {
        toast(e.toString().replaceAll(new RegExp('Exception: '), ''));
        throw new Exception(e);
      }
    });
  
  
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);
  