Index and length must refer to a location within the string. Parameter name: length
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. Parameter name: length
Source Error:
Line 342: key[i] = Convert.ToByte(claveHex.Substring(p, 2), 16);
Line 343: IV[i] = Convert.ToByte(vectorHex.Substring(p, 2), 16);
Line 344: encrypted[i] = Convert.ToByte(cadena.Substring(p, 2), 16);
Line 345: }
Line 346: // desencriptar con Rijndael