mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Simplified some names
This commit is contained in:
parent
947aba84ee
commit
c257ef5a6e
1 changed files with 11 additions and 11 deletions
|
|
@ -13,31 +13,31 @@ class EncryptedString
|
||||||
|
|
||||||
public EncryptedString(string String)
|
public EncryptedString(string String)
|
||||||
{
|
{
|
||||||
this.des.GenerateIV();
|
des.GenerateIV();
|
||||||
this.des.GenerateKey();
|
des.GenerateKey();
|
||||||
this.Set(String);
|
Set(String);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EncryptedString()
|
public EncryptedString()
|
||||||
{
|
{
|
||||||
this.des.GenerateIV();
|
des.GenerateIV();
|
||||||
this.des.GenerateKey();
|
des.GenerateKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Get()
|
public string Get()
|
||||||
{
|
{
|
||||||
if (this.encryptedString == null) return null;
|
if (encryptedString == null) return null;
|
||||||
var decryptor = this.des.CreateDecryptor();
|
var decryptor = des.CreateDecryptor();
|
||||||
byte[] output = decryptor.TransformFinalBlock(this.encryptedString, 0, this.encryptedString.Length);
|
byte[] output = decryptor.TransformFinalBlock(encryptedString, 0, encryptedString.Length);
|
||||||
return Encoding.Default.GetString(output);
|
return Encoding.Default.GetString(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(string String)
|
public void Set(string String)
|
||||||
{
|
{
|
||||||
if (String == null) { this.encryptedString = null; return; }
|
if (String == null) { encryptedString = null; return; }
|
||||||
var encryptor = this.des.CreateEncryptor();
|
var encryptor = des.CreateEncryptor();
|
||||||
byte[] str = Encoding.Default.GetBytes(String);
|
byte[] str = Encoding.Default.GetBytes(String);
|
||||||
this.encryptedString = encryptor.TransformFinalBlock(str, 0, str.Length);
|
encryptedString = encryptor.TransformFinalBlock(str, 0, str.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue