String sb = “abcdefghigklmnopqrstuvwxyz”;
List<byte[]>encryptionList = new LinkedList<byte[]>();
byte[] cardByte = null;
try {
cardByte = sb.getBytes("UTF-8");
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
int temp=0;
int n =5
int i = 0;
try {
for(; i< cardByte.length/n;i++){
byte[] data = new byte[n];
for(int j=0; j<n;j++){
if(temp<n && temp!=n){
data[j] = cardByte[j];
}else{
data[j] = cardByte[temp];
}
temp = temp+1;
}
byte[] encrpyData = encryptByOriginalPrivateKey(data, keyBytes);
encryptionList.add(encrpyData);
}
if(cardByte.length-n*i>0){
byte [] data = new byte[cardByte.length-n*i];
for(int k=0;k<cardByte.length-n*i;k++){
data[k] = cardByte[k+n*i];
}
byte[] encrpyData = RSACoder.encryptByOriginalPrivateKey(data, keyBytes);
encryptionList.add(encrpyData);
}
} catch (Exception e) {
e.printStackTrace();
}