synchronous vs asynchronous functions code example

Example 1: async vs sync

synchronous (sync) - you can only execute one thing at a time
asynchronous (async) - you can execute multiple things at the same time

Example 2: synchronous vs asynchronous encryption

Encryption can be synchronous or asynchronous. Synchronous cryptography is mostly used for data at rest, and also for digital signature. Asynchronous cryptography is usually used for data in transit and in cases where encryption and decryption keys need to be shared or exchanged.

Tags:

Misc Example