--snip--
Thanks for example of running the program along with the explanation. I initially though the software isn't work as intended due to message "-i used with no filenames ...". Retesting the software, it works just fine on Debian 11 (dc 1.4.1 and perl 5.32.1).
$ cat rsa
#!/bin/perl -sp0777i$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
$ echo "squeamish ossifrage" | ./rsa -k=10001 -n=1967cb529 > msg.rsa
-i used with no filenames on the command line, reading from STDIN.
$ xxd msg.rsa
00000000: 073d 46d6 b56a de04 7b32 92f0 a363 c331 .=F..j..{2...c.1
00000010: e902 ee83 3b ....;
$ ./rsa -d -k=ac363601 -n=1967cb529 < msg.rsa
-i used with no filenames on the command line, reading from STDIN.
squeamish ossifrage