|
@@ -14,7 +14,13 @@ namespace shadowsocks_csharp.Encrypt |
|
|
{"aes-256-cfb", new int[]{32, 16}},
|
|
|
{"aes-256-cfb", new int[]{32, 16}},
|
|
|
{"bf-cfb", new int[]{16, 8}},
|
|
|
{"bf-cfb", new int[]{16, 8}},
|
|
|
{"rc4", new int[]{16, 0}}, |
|
|
{"rc4", new int[]{16, 0}}, |
|
|
}; |
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static OpensslEncryptor()
|
|
|
|
|
|
{
|
|
|
|
|
|
OpenSSL.OpenSSL_add_all_ciphers();
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public OpensslEncryptor(string method, string password) |
|
|
public OpensslEncryptor(string method, string password) |
|
|
: base(method, password) |
|
|
: base(method, password) |
|
|
{ |
|
|
{ |
|
@@ -85,7 +91,6 @@ namespace shadowsocks_csharp.Encrypt |
|
|
|
|
|
|
|
|
private void InitKey(string method, string password)
|
|
|
private void InitKey(string method, string password)
|
|
|
{
|
|
|
{
|
|
|
OpenSSL.OpenSSL_add_all_ciphers();
|
|
|
|
|
|
method = method.ToLower();
|
|
|
method = method.ToLower();
|
|
|
string k = method + ":" + password;
|
|
|
string k = method + ":" + password;
|
|
|
_cipher = OpenSSL.EVP_get_cipherbyname(System.Text.Encoding.UTF8.GetBytes(method));
|
|
|
_cipher = OpenSSL.EVP_get_cipherbyname(System.Text.Encoding.UTF8.GetBytes(method));
|
|
|