Encryption for portable devices