code: function rsaEncrypt(messageBuffer, publicKey) {
      var logger = getLogger('security.cipher.rsaEncrypt');
      var messageLength = messageBuffer.length;
      if (!messageBuffer || messageLength > 255) {
          logger.warn('Message is undefined or exceeds 255 bytes length.');
          return;
      } else if (messageLength < 255) {
          // Add random bytes as padding
          var paddingLength = 255 - messageLength;
          messageBuffer = Buffer.concat([messageBuffer, utility.createRandomBuffer(paddingLength)]);
      }
      // Encrypt the message
      var modulus = new BigInteger(publicKey.getModulus(), 16);
      var exponent = new BigInteger(publicKey.getExponent(), 16);
      var message = new BigInteger(messageBuffer);
      var encryptedMessage = new Buffer(message.modPowInt(exponent, modulus).toByteArray());
      if (encryptedMessage.length > 256) {
          encryptedMessage = encryptedMessage.slice(encryptedMessage.length - 256);
      }
      if (logger.isDebugEnabled()) {
          logger.debug('Plain-text message(%s) = %s', messageBuffer.length, messageBuffer.toString('hex'));
          logger.debug('Encrypted message(%s) = %s', encryptedMessage.length, encryptedMessage.toString('hex'));
      }
      return encryptedMessage;
  }
docs: RSA encrypt function, requires: - publicKey - messageBuffer