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)
|
||||
{
|
||||
this.des.GenerateIV();
|
||||
this.des.GenerateKey();
|
||||
this.Set(String);
|
||||
des.GenerateIV();
|
||||
des.GenerateKey();
|
||||
Set(String);
|
||||
}
|
||||
|
||||
public EncryptedString()
|
||||
{
|
||||
this.des.GenerateIV();
|
||||
this.des.GenerateKey();
|
||||
des.GenerateIV();
|
||||
des.GenerateKey();
|
||||
}
|
||||
|
||||
public string Get()
|
||||
{
|
||||
if (this.encryptedString == null) return null;
|
||||
var decryptor = this.des.CreateDecryptor();
|
||||
byte[] output = decryptor.TransformFinalBlock(this.encryptedString, 0, this.encryptedString.Length);
|
||||
if (encryptedString == null) return null;
|
||||
var decryptor = des.CreateDecryptor();
|
||||
byte[] output = decryptor.TransformFinalBlock(encryptedString, 0, encryptedString.Length);
|
||||
return Encoding.Default.GetString(output);
|
||||
}
|
||||
|
||||
public void Set(string String)
|
||||
{
|
||||
if (String == null) { this.encryptedString = null; return; }
|
||||
var encryptor = this.des.CreateEncryptor();
|
||||
if (String == null) { encryptedString = null; return; }
|
||||
var encryptor = des.CreateEncryptor();
|
||||
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