Key exchange protocol without using external flash memory