示例#1
0
    def wrap_header(self, base_hdr):
        iv = os.urandom(16)
        self.__iv = iv
        seq = [base_hdr, self.__const_fill]
        e_data = aes_cfb.encrypt(self.__key, self.__iv, b"".join(seq))

        return iv + e_data
示例#2
0
 def wrap_header(self, base_hdr):
     iv = os.urandom(16)
     self.__iv = iv
     seq = [
         base_hdr,
         self.__const_fill
     ]
     e_data = aes_cfb.encrypt(self.__key, self.__iv, b"".join(seq))
     return iv + e_data
示例#3
0
    def wrap_body(self, size, body_data):
        filled = bytes(aes_cfb.get_size(size) - size)

        return aes_cfb.encrypt(self.__key, self.__iv, body_data + filled)
示例#4
0
文件: aes_udp.py 项目: xxoxx/fdslight
 def wrap_body(self, size, body_data):
     return aes_cfb.encrypt(self.__key, self.__iv, body_data)
示例#5
0
    def wrap_body(self, size, body_data):
        filled = bytes(aes_cfb.get_size(size) - size)

        return aes_cfb.encrypt(self.__key, self.__iv, body_data + filled)