I have bunch of log files which I am trying to encrypt with public/private key using openssl and save to my NAS but it is failing. My log files are in the following path :/var/SYSLOGS/hosts/archiveMy public key and private key are in /etc/log-enc/[root@NAG01 log-enc]# ls -ltotal 8-rw-r--r-- 1 root root 891 Jul 11 15:58 syslog_privalye_key.pem-rw-r--r-- 1 root root 272 Jul 11 15:59 syslog_public_key.pemNow I am trying to execute following commandIf I am executing the same command one by one, then there is no issue. for file in `find /var/SYSLOGS/hosts/archive/`do  FILE_BASE=$(basename $file)echo $file=>/NFS/Nag01/syslogs/hosts/$FILE_BASE.encopenssl rsautl -encrypt -inkey  /etc/log-enc/syslog_public_key.pem -pubin -in $file -out /NFS/Nag01/syslogs/hosts/$FILE_BASE.encdoneHere are the error logsRSA operation error140628568049480:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:rsa_pk1.c:151:/var/SYSLOGS/hosts/archive/192.168.33.5.log-20160131.gz=>/NFS/Nag01/syslogs/hosts/192.168.33.5.log-20160131.gz.encRSA operation error140123978278728:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:rsa_pk1.c:151:/var/SYSLOGS/hosts/archive/app02.log-20160306.gz=>/NFS/Nag01/syslogs/hosts/app02.log-20160306.gz.enc/var/SYSLOGS/hosts/archive/192.168.34.8.log-20160227.gz=>/NFS/Nag01/syslogs/hosts/192.168.34.8.log-20160227.gz.encRSA operation error139777258493768:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:rsa_pk1.c:151:/var/SYSLOGS/hosts/archive/192.168.31.3.log-20160511.gz=>/NFS/Nag01/syslogs/hosts/192.168.31.3.log-20160511.gz.encHere are the raw files.[root@NAG01 log-enc]# ls -l /var/SYSLOGS/hosts/archive/192.168.33.5.log-20160131.gz-rw-------. 1 root root 3569 Jan 31 04:16 /var/SYSLOGS/hosts/archive/192.168.33.5.log-20160131.gz[root@NAG01 log-enc]# ls -l /var/SYSLOGS/hosts/archive/192.168.34.8.log-20160227.gz-rw-------. 1 root root 2142 Feb 27 03:11 /var/SYSLOGS/hosts/archive/192.168.34.8.log-20160227.gz
mass file encryption not working with openssl
logs;encryption;openssl