36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
# -----------------------------------------------------------------------------
|
|
# Title : Quartus Key generation
|
|
# Project : Generic FW tools
|
|
# -----------------------------------------------------------------------------
|
|
# File : gen_key_file.py
|
|
# Author : Simon Southwell
|
|
# Company : Global Inkjet Systems
|
|
# Created : 2018-03-14
|
|
# Last update: 2018-03-14
|
|
# Platform :
|
|
# Standard : Python 3.x
|
|
# -----------------------------------------------------------------------------
|
|
# Description:
|
|
# Generates a set of keys for a .key file for FPGA encryption
|
|
# -----------------------------------------------------------------------------
|
|
# Copyright (c) 2018 Global Inkjet Systems
|
|
# -----------------------------------------------------------------------------
|
|
|
|
import random
|
|
|
|
# ###############################################################
|
|
# Only run if not imported (to test)
|
|
#
|
|
if __name__ == '__main__':
|
|
|
|
str = 'key1 '
|
|
|
|
for key in range(2) :
|
|
|
|
for idx in range(32) :
|
|
val = random.randint(0, 255)
|
|
str += format(val, '02x')
|
|
|
|
print(str)
|
|
str = 'key2 '
|
|
|