use https://github.com/KZen-networks/rust-paillier for Paillier or use a standard crypto library for RSA.