Skip to content

Instantly share code, notes, and snippets.

View Anass-ABEA's full-sized avatar
🎯
Focusing

WhiteBatCodes Anass-ABEA

🎯
Focusing
View GitHub Profile
@Anass-ABEA
Anass-ABEA / RSA.java
Created July 25, 2021 00:33
RSA Decryption Client
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import javax.crypto.Cipher;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
@Anass-ABEA
Anass-ABEA / RSA.java
Created July 25, 2021 00:27
RSA encryption/Decryption with a specific public/private Key.
import javax.crypto.Cipher;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
/**
* @author Anass AIT BEN EL ARBI
* <ul>
* <li>AES/CBC/NoPadding (128)</li>
@Anass-ABEA
Anass-ABEA / RSA.java
Last active November 11, 2021 09:57
helper methods to encode and decode Strings using the Base64 encoder and decoder
import javax.crypto.Cipher;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Base64;
/**
* @author Anass AIT BEN EL ARBI
* <ul>