xit-aria 추가
parent
c8e3cca90f
commit
dce94b45db
Binary file not shown.
@ -0,0 +1,38 @@
|
||||
package cokr.xit.base.crypto.bean;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
|
||||
import cokr.xit.base.crypto.Cryptography;
|
||||
|
||||
public class XitAria extends Cryptography {
|
||||
private String key;
|
||||
|
||||
public XitAria(String name) {
|
||||
super(name);
|
||||
setKey(def.settings().string("key"));
|
||||
}
|
||||
|
||||
public XitAria setKey(String key) {
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doEncrypt(String plain) throws Exception {
|
||||
return Header.INSTANCE.XIT_AriaCrypt_Java(key, plain);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doDecrypt(String encrypted) throws Exception {
|
||||
return Header.INSTANCE.XIT_AriaDeCrypt_Java(key, encrypted);
|
||||
}
|
||||
|
||||
public static interface Header extends StdCallLibrary {
|
||||
Header INSTANCE = Native.loadLibrary("3rd-party/xit-aria/XAria", XitAria.Header.class);
|
||||
|
||||
String XIT_AriaCrypt_Java(String AKey, String AValue);
|
||||
|
||||
String XIT_AriaDeCrypt_Java(String AKey, String AValue);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue