better boot checking and key generation