fix bug converting 'null' private key to variant
various updates and enhancements to crypto and network code