Added the possibility to automatically encrypt/decrypt a configuration value by setting "Encrypted" in the ini to true. Also added a small OAuth example in the ImgurUtils, for later usage.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2014 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-09-09 13:53:53 +00:00
parent b2ea24fd9a
commit 79cbe548b0
4 changed files with 41 additions and 2 deletions

View file

@ -36,7 +36,7 @@ namespace GreenshotPlugin.Core {
/// <param name="ClearText">the string to call upon</param>
/// <returns>an encryped string in base64 form</returns>
public static string Encrypt(this string ClearText) {
string returnValue = null;
string returnValue = ClearText;
try {
byte[] clearTextBytes = Encoding.ASCII.GetBytes(ClearText);
SymmetricAlgorithm rijn = SymmetricAlgorithm.Create();
@ -63,7 +63,7 @@ namespace GreenshotPlugin.Core {
/// <param name="EncryptedText">a base64 encoded rijndael encrypted string</param>
/// <returns>Decrypeted text</returns>
public static string Decrypt(this string EncryptedText) {
string returnValue = null;
string returnValue = EncryptedText;
try {
byte[] encryptedTextBytes = Convert.FromBase64String(EncryptedText);
using (MemoryStream ms = new MemoryStream()) {