(self,filename)
return
Read in given .kdb file
Read in given .kdb file
Read in given . kdb file
def read(self,filename):
        'Read in given .kdb file'
        fp = open(filename)
        buf = fp.read()
        fp.close()

        headbuf = buf[:124]
        self.header = DBHDR(headbuf)
        self.groups = []
        self.entries = []

        payload = buf[124:]

        self.finalkey = self.final_key(self.masterkey,
                                       self.header.master_seed,
                                       self.header.master_seed2,
                                       self.header.key_enc_rounds)
        payload = self.decrypt_payload(payload, self.finalkey, 
                                       self.header.encryption_type(),
                                       self.header.encryption_iv)

        ngroups = self.header.ngroups
        while ngroups:
            gi = GroupInfo(payload)
            self.groups.append(gi)
            length = len(gi)
            payload = payload[length:]
            ngroups -= 1
            continue

        nentries = self.header.nentries
        while nentries:
            ei = EntryInfo(payload)
            self.entries.append(ei)
            payload = payload[len(ei):]
            nentries -= 1
            continue
        return
def read ( self , filename ) : fp = open ( filename ) buf = fp . read ( ) fp . close ( ) headbuf = buf [ : 124 ] self . header = DBHDR ( headbuf ) self . groups = [ ] self . entries = [ ] payload = buf [ 124 : ] self . finalkey = self . final_key ( self . masterkey , self . header . master_seed , self . header . master_seed2 , self . header . key_enc_rounds ) payload = self . decrypt_payload ( payload , self . finalkey , self . header . encryption_type ( ) , self . header . encryption_iv ) ngroups = self . header . ngroups while ngroups : gi = GroupInfo ( payload ) self . groups . append ( gi ) length = len ( gi ) payload = payload [ length : ] ngroups -= 1 continue nentries = self . header . nentries while nentries : ei = EntryInfo ( payload ) self . entries . append ( ei ) payload = payload [ len ( ei ) : ] nentries -= 1 continue return