The objective of this course is to highlight the threats faced by computer systems, with a focus on protecting the data they handle. Once these threats are understood, the course explores cryptographic mechanisms that can mitigate them. These mechanisms are also directly or indirectly used in blockchains. The fundamentals of blockchains, the programming of applications based on them, and their associated security issues are also covered in this course. Finally, a brief overview of the regulatory and legal aspects related to cybersecurity is provided.