def encrypt(self, message):
        # TODO: Verify the key is RSA
    
        randFunc = self._key._randfunc
    
        # See 7.2.1 in RFC3447
        modBits = Crypto.Util.number.size(self._key.n)
        k = ceil_div(modBits,8) # Convert from bits to bytes
        mLen = len(message)
    
        # Step 1
        if mLen > k-11:
            raise ValueError("Plaintext is too long.")
        # Step 2a
        class nonZeroRandByte:
            def __init__(self, rf): self.rf=rf
            def __call__(self, c):
                while bord(c)==0x00: c=self.rf(1)[0]
                return c
        ps = tobytes(map(nonZeroRandByte(randFunc), randFunc(k-mLen-3)))
        # Step 2b
        em = b('\x00\x02') + ps + bchr(0x00) + message
        # Step 3a (OS2IP), step 3b (RSAEP), part of step 3c (I2OSP)
        m = self._key.encrypt(em, 0)[0]
        # Complete step 3c (I2OSP)
        c = bchr(0x00)*(k-len(m)) + m
        return c
simulate behaviour of group b member
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Cipher/PKCS1_v1_5.py/PKCS115_Cipher.encrypt--crossover with--dataset/ETHPy150Open divio/django-cms/cms/tests/test_menu_page_viewperm_staff.py/ViewPermissionComplexMenuStaffNodeTests.test_node_staff_access_page_and_children_group_1