Generates a random key file in the QUARTUS format
This commit is contained in:
parent
755e856080
commit
6abc3fcd58
1 changed files with 36 additions and 0 deletions
36
utilities/gen_key_file.py
Normal file
36
utilities/gen_key_file.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# -----------------------------------------------------------------------------
|
||||
# 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 '
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue