コード例 #1
0
    private string Base64DecodeAndDecrypt(string base64CypherText)
    {
        if (m_encryptor != null)
        {
            byte[] cypherTextBytes = Convert.FromBase64String(base64CypherText);
            byte[] plainTextBytes  = m_encryptor.Decrypt_CBC(cypherTextBytes);

            // Trim any null terminators off the end
            return(Encoding.ASCII.GetString(plainTextBytes).TrimEnd(new char[] { '\0' }));
        }
        else
        {
            return(base64CypherText);
        }
    }