Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

src/b/l/BlueCop-XBMC-Plugins-HEAD/script.module.cryptopy/lib/crypto/cipher/trolldoll.py   BlueCop-XBMC-Plugins(Download)
        if more == None:    # on last call to encrypt append integrity check
            plainText = plainText + self._makeIC()
        return Icedoll.encrypt(self, plainText, more=more)
 
    def decrypt(self, cipherText, more=None):

src/b/l/BlueCop-XBMC-Plugins-HEAD/script.module.cryptopy/lib/crypto/icedoll_test.py   BlueCop-XBMC-Plugins(Download)
    def testDctEqPt(self):
        """ test of plaintext = decrypt(encrypt(plaintext)) """
        alg = Icedoll( 16*chr(0), padding=noPadding())
        pt  = 16*4*'a'             # block aligned
        ct  = alg.encrypt(pt)
        alg = Icedoll( 16*chr(0))  # autoPad
        pt  = 17*4*'a'             # non-block aligned
        ct  = alg.encrypt(pt)
        print 'ct  = ',b2a_p(ct)
        dct = alg.decrypt(ct)
        for size in range(100):
            pt = size*'a'
            ct = alg.encrypt(pt)
            #print 'ct  = ',b2a_p(ct)
            dct = alg.decrypt(ct)

src/b/l/BlueCop-XBMC-Plugins-HEAD/script.module.cryptopy/lib/crypto/cipher/icedoll_test.py   BlueCop-XBMC-Plugins(Download)
    def testDctEqPt(self):
        """ test of plaintext = decrypt(encrypt(plaintext)) """
        alg = Icedoll( 16*chr(0), padding=noPadding())
        pt  = 16*4*'a'             # block aligned
        ct  = alg.encrypt(pt)
        alg = Icedoll( 16*chr(0))  # autoPad
        pt  = 17*4*'a'             # non-block aligned
        ct  = alg.encrypt(pt)
        print 'ct  = ',b2a_p(ct)
        dct = alg.decrypt(ct)
            bSize = len(cipherText) # set block size to length of block
            alg = Icedoll(bkey, keySize=kSize, blockSize=bSize, padding=noPadding())
            cct = alg.encrypt(plainText)
            print 'pt    =',b2a_p(plainText)
            print 'ct    =',b2a_p(cct)