(self, verbose=False)
Generates a new AES cipher from the serial number and headset version.
        :return: New AES cipher
Generates a new AES cipher from the serial number and headset version.
        :return: New AES cipher
Generates a new AES cipher from the serial number and headset version . : return : New AES cipher
def new_cipher(self, verbose=False):
        """
        Generates a new AES cipher from the serial number and headset version.
        :return: New AES cipher
        """
        if verbose:
            print("EmotivCrypto: Generating new AES cipher.")
        # Create initialization vector.
        iv = os.urandom(AES.block_size)
        # Make sure the serial number was set.
        if self.serial_number is None:
            raise ValueError("Serial number must not be None.")
        if verbose:
            print("EmotivCrypto: Serial Number - {serial_number}".format(serial_number=self.serial_number))
        # Create and return new AES class, using the serial number and headset version.
        if self.serial_number.startswith('UD2016') and not self.force_old_crypto:
            if self.force_epoc_mode:
                return AES.new(epoc_plus_crypto_key(self.serial_number), AES.MODE_ECB, iv)
            else:
                return AES.new(new_crypto_key(self.serial_number, self.verbose))
        else:
            return AES.new(crypto_key(self.serial_number, self.is_research, verbose), AES.MODE_ECB, iv)
def new_cipher ( self , verbose = False ) : if verbose : print ( "EmotivCrypto: Generating new AES cipher." ) # Create initialization vector. iv = os . urandom ( AES . block_size ) # Make sure the serial number was set. if self . serial_number is None : raise ValueError ( "Serial number must not be None." ) if verbose : print ( "EmotivCrypto: Serial Number - {serial_number}" . format ( serial_number = self . serial_number ) ) # Create and return new AES class, using the serial number and headset version. if self . serial_number . startswith ( 'UD2016' ) and not self . force_old_crypto : if self . force_epoc_mode : return AES . new ( epoc_plus_crypto_key ( self . serial_number ) , AES . MODE_ECB , iv ) else : return AES . new ( new_crypto_key ( self . serial_number , self . verbose ) ) else : return AES . new ( crypto_key ( self . serial_number , self . is_research , verbose ) , AES . MODE_ECB , iv )