/*
Kooboo is a content management system based on ASP.NET MVC framework. Copyright 2009 Yardi Technology Limited.
This program is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see http://www.kooboo.com/gpl3/.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Everest.Library.Providers.Cryptography{
public interface ICryptographyProvider
{
/// <summary>
/// Compares plain text input with a computed hash .
/// </summary>
/// <param name="plaintext">The plaintext.</param>
/// <param name="hashedText">The hashed text.</param>
/// <returns></returns>
bool CompareHash(string plaintext, string hashedText);
/// <summary>
/// Compares plain text input with a computed hash.
/// </summary>
/// <param name="plaintext">The plaintext.</param>
/// <param name="hashedText">The hashed text.</param>
/// <returns></returns>
bool CompareHash(byte[] plaintext, byte[] hashedText);
/// <summary>
/// Computes the hash value of plain text.
/// </summary>
/// <param name="plainText">The plain text.</param>
/// <returns></returns>
string CreateHash(string plainText);
/// <summary>
/// Computes the hash value of plain text.
/// </summary>
/// <param name="plaintext">The plaintext.</param>
/// <returns></returns>
byte[] CreateHash(byte[] plaintext);
/// <summary>
/// Decrypts a cipher text.
/// </summary>
/// <param name="ciphertext">The ciphertext.</param>
/// <returns></returns>
byte[] DecryptSymmetric(byte[] ciphertext);
/// <summary>
/// Decrypts a cipher text.
/// </summary>
/// <param name="ciphertextBase64">The ciphertext base64.</param>
/// <returns></returns>
string DecryptSymmetric(string ciphertextBase64);
/// <summary>
/// Encrypts a secret.
/// </summary>
/// <param name="plaintext">The plaintext.</param>
/// <returns></returns>
byte[] EncryptSymmetric(byte[] plaintext);
/// <summary>
/// Encrypts a secret.
/// </summary>
/// <param name="plaintext">The plaintext.</param>
/// <returns></returns>
string EncryptSymmetric(string plaintext);
}
}
|