/* When used as an argument for the Unix utility, bc, this script implements the function e(m,p,q) which returns m raised to the p power, modulo q. This function was used to create modular inverse pairs which, can be used to set up encryption decryption pairs for rsa encryption. */ define e(m,p,q) { auto j , z z = 1 for(j = p ; j > 0 ; j = j / 2 ) { if( j % 2 == 1 ) { z = z * m % q } m = m * m % q } return(z) } /* e(m,p,q) returns m raised to the p power modulo q. */