Skip to content

Latest commit

 

History

History
92 lines (61 loc) · 3.12 KB

AES.md

File metadata and controls

92 lines (61 loc) · 3.12 KB

AES encryption package

AES algorithms available

  • CBC
  • CFB
  • OFB
  • CTR

The other algorithms will be gradually released

Usage/Examples

create keys

//create an initialization vector with AESServerCipher.createBase64IvParameterSpec(); method
String IV_SPEC = "ciiz/UZ+oRliqYXVogTYfw==";
//create a secret key with AESServerCipher.createBase64SecretKey(keySize); method
String SECRET_KEY = "ousG/n0Q7UD6bgamAxktgu3nU1jMntv3YuF1g19mb9c="; 

Client

import com.tecknobit.apimanager.apis.encryption.aes.AESClientCipher.Algorithm;

public class Client {

    public static void main(String[] args) throws Exception {
        Algorithm algorithm = Algorithm.CBC_ALGORITHM;
        ClientCipher cipher = new ClientCipher(IV_SPEC, SECRET_KEY, algorithm);
        System.out.println(cipher.encryptBase64("your plain text"));
    }
    //output: 26XBx/esnnrehi/GH3tpnQ==
}

Server

import com.tecknobit.apimanager.apis.encryption.aes.AESClientCipher.Algorithm;

public class Server {
    
    public static void main(String[] args) throws Exception {
        Algorithm algorithm = Algorithm.CBC_ALGORITHM;
        AESServerCipher serverCipher = new AESServerCipher(IV_SPEC, SECRET_KEY, algorithm); 
        System.out.println(cipher.decryptBase64("26XBx/esnnrehi/GH3tpnQ=="));
    }
    //output: your plain text
}

Authors

Support

If you need help using the library or encounter any problems or bugs, please contact us via the following links:

Thank you for your help!

Badges

Twitter

Donations

If you want support project and developer

Crypto Address Network
3H3jyCzcRmnxroHthuXh22GXXSmizin2yp Bitcoin
0x1b45bc41efeb3ed655b078f95086f25fc83345c4 Ethereum

If you want support project and developer with PayPal

Copyright © 2024 Tecknobit