Welcome to lark3ri.com

Convert F-Secure KEY exported json file to csv


If you need to transfer accounts from the F-Secure KEY to the KeePassXC, this is the solution to go. The F-Secure KEY does not have the Linux support. In the Linux i'm using the KeePassXC application so i needed to move all my stored accounts from the F-Secure KEY to the KeePassXC application.

Turned out that the F-Secure KEY does not support any other format to export the accounts than json and the KeePassXC wont support json format so i needed to make this little Python code to make the convert from json to csv. Here it is if someone is in a similar situation and needs this.

import json

if __name__ == '__main__':
	with open('ExportedPasswords.fsk', 'r', encoding='utf-8') as json_file:
		data = json.load(json_file)
		str_ = ''
		for key, value in data['data'].items():
			service =   value['service'].replace('"', '""')
			username =  value['username'].replace('"', '""')
			password =  value['password'].replace('"', '""')
			url =       value['url'].replace('"', '""')
			notes =     value['notes'].replace('"', '""')
			str_ += f'"Root","{service}","{username}","{password}","{url}","{notes}"\n'

		file = open('output.csv', 'w', encoding='utf-8')
« Back | ↑ Top