​ ARSA is a cross-platform RSA encryption and signature library. The key and text exported can be circulated in all languages that ARSA supports.
​ Most importantly, it is incredibly easy to master with a handful of actual code.
- Do standard RSA encryption and signature
- Encrypt long texts
- Cross platform
- One single unified format in all languages
- Download and import
- Create new ARSA keys
- Import existed keys
- Export keys to Strings
- Encrypt
- Decrypt
- Make signatures
- Verify signatures
- Key objects conversion
-
Download the source code (.java) here or install it through Maven Central:
dependencies { implmentation 'com.atatctech:arsa:2.0.0' }
<dependency> <groupId>com.atatctech</groupId> <artifactId>arsa</artifactId> <version>2.0.0</version> </dependency>
Then import:
import com.atatctech.arsa.ARSA;
Download the source code (.py) here or install it through Pip:
pip install arsa
pip3 install arsa
Then import:
from arsa import *
-
int keyLength; // RSA key length, 2048 recommended ARSA.AKeyPair keyPair = ARSA.newkeys(keyLength);
ARSA.APublicKey publicKey = keyPair.getPublicKey();
ARSA.APrivateKey privateKey = keyPair.getPrivateKey();
key_pair = new_keys()
or
key_length: int # RSA key length, 2048 in default key_pair = new_keys(key_length)
public_key: APublicKey = key_pair.get_public_key()
private_key: APrivateKey = key_pair.get_private_key()
-
-
String publicKeyString; int keyLength; ARSA.APublicKey publicKey = ARSA.APublicKey.importPublicKey(publicKeyString, keyLength);
Or from
java.security.PublicKey
:PublicKey publicKeyObject; int keyLength; ARSA.APublicKey publicKey = ARSA.APublicKey.importPublicKey(publicKeyObject, keyLength);
public_key_bytes: bytes key_length: int APublicKey public_key = APublicKey.import_public_key(public_key_bytes, key_length)
-
Just change every "public" above to "private".
-
-
-
ARSA.APublicKey publicKey; String publicKeyString = publicKey.toString();
public_key: APublicKey public_key_string: str = str(public_key)
-
Just change every "public" above to "private".
-
-
ARSA.APublicKey publicKey; String plainText; String cipherText = ARSA.encrypt(plainText, publicKey);
public_key: APublicKey plain_text: str cipher_text: bytes = encrypt(plain_text, public_key);
-
ARSA.APrivateKey privateKey; String cipherText; String plainText = ARSA.decrypt(cipherText, privateKey);
private_key: APrivateKey cipher_text: base64.bytes_types plain_text: str = decrypt(cipher_text, private_key)
-
String content; ARSA.APrivateKey privateKey; String signature = ARSA.sign(content, privateKey);
content: base64.bytes_types private_key: APrivateKey signature: bytes = sign(content, private_key)
-
String content; String signature; ARSA.APublicKey publicKey; boolean isQualified = ARSA.verify(content, signature, publicKey);
content: base64.bytes_types signature: bytes public_key: APublicKey bool is_qualified = verify(content, signature, public_key)
-
-
APublicKey publicKey; PublicKey publicKeyObject = publicKey.getPublicKey();
APrivateKey privateKey; PrivateKey privateKeyObject = privateKey.getPrivateKey();
-
public_key: APublicKey public_key_object: PublicKey = public_key.get_public_key()
private_key: APrivateKey private_key_object: RsaKey = private_key.get_private_key()
-