DES with Padding PKCS7

Hi,, Iam adam.
I am still a newbie in security arduino . I have an example of DES security code with a maximum of 8 characters plaintext input string.

#include <DES.h>

DES des;

void setup() {
Serial.begin(9600);
while (!Serial);
}

void loop() {
desTest();
delay(2000);
}

void desTest()
{
int n;
byte out[16];
byte in[] = ("#N1X5Y6!");
des.calc_size_n_pad(sizeof(in));
byte in_p[des.get_size()];
des.padPlaintext(in,in_p);
byte cyphertext[des.get_size()];
byte key[] = ("TELKOM12");

Serial.println();
Serial.println("========= DES test ==========");
Serial.println("Start");
Serial.print ("Keyword = ");
for (int j=0;j<8;j++){
if (key[j]<0x10) Serial.print("0");
Serial.print(key[j],HEX);Serial.print(" ");
}

Serial.println();
Serial.print ("Plaintext = ");
for (int j=0;j<8;j++){
if (in[j]<0x10) Serial.print("0");
Serial.print(in[j],HEX);Serial.print(" ");
}
Serial.println();
//encrypt
Serial.print("Encrypt...");
unsigned long time = micros();
des.encrypt(out, in, key);
time = micros() - time;
Serial.print("done. (");
Serial.print(time);
Serial.println(" micros)");
printArray(out);

//decrypt
for (int i = 0; i < 8; i++)
{
in = out*;*
* }*
* Serial.print("Decrypt...");*
* time = micros();*
* des.decrypt(out, in, key);*
* time = micros() - time;*
* Serial.print("done. (");*
* Serial.print(time);*
* Serial.println(" micros)");*
* printArray(out);*
}
void printArray(byte output[])
{
* for (int i = 0; i < 8; i++)*
* {*
_ if (output < 0x10)
* {
Serial.print("0");
}
Serial.print(output, HEX);
Serial.print(" ");
}
Serial.println();
}*

I want to try to add padding to the size of the plaintext by using PKCS7. can anyone help me ?
I say thank you very much._

  byte in[] = ("#N1X5Y6!");
  des.calc_size_n_pad(sizeof(in));
  byte in_p[des.get_size()];
  des.padPlaintext(in,in_p);

Looks like your code uses the DES library to pad the plaintext. Did you want to change the DES library so it would use PKCS#7 padding or did you want to pad your plain text with PKCS#7 so the DES library would have no padding to do?

I say thank you for your response. if possible to use PKCS7 on the main code is not in the library , can you help me ?

basically I just wanted to add the amount of plaintext . if I use the code above , for example :
in byte [ ] = (" # N1X5.78678975Y6.967678897 ! ") ;
then encrypted only the first 8 characters . and the rest of the other characters on ignore.

can you help me sir? thank you very much

   //decrypt
   for (int i = 0; i < 8; i++) {
       in[i] = out[i];
      }

This part only copies 8 bytes from the encrypted array (out) so it can be decrypted.

   printArray(out);The "printArray()" function will only display the first 8 bytes of the array

Try using "des.get_size()" instead of "8" in the copy loop and in printArray().