What is the difference between symmetric and asymmetric encryption?

Symmetric Encryption: Uses the same key for both encryption and decryption. It is faster than asymmetric encryption but has the challenge of securely sharing the key.

Asymmetric Encryption: Uses a pair of keys: a public key for encryption and a private key for decryption. The public key can be shared freely, while the private key must be kept secret. It is slower than symmetric encryption but solves the key exchange problem.

Explain the concept of public key infrastructure (PKI).

Public Key Infrastructure (PKI) is a set of roles, policies, and procedures needed to create, manage, distribute, use, store, and revoke digital certificates and manage public-key encryption. The purpose of a PKI is to facilitate the secure electronic transfer of information for a range of network activities such as e-commerce, internet banking and confidential email.

How would you protect a web application from SQL injection?

To protect a web application from SQL injection, you can use the following techniques:

  • Prepared Statements (with Parameterized Queries): This is the most effective way to prevent SQL injection.
  • Input Validation: Validate all user input to ensure that it is of the correct type, length, and format.
  • Principle of Least Privilege: The database user account that the web application uses to connect to the database should have the minimum necessary privileges.

What is the difference between IDS and IPS?

IDS (Intrusion Detection System): A monitoring system that detects suspicious activities and generates alerts. It does not take any action to prevent the attack.

IPS (Intrusion Prevention System): A control system that detects suspicious activities and takes action to prevent them, such as blocking the traffic or resetting the connection.

Explain zero-trust security architecture.

Zero-trust security is a security model based on the principle of maintaining strict access controls and not trusting anyone by default, even those inside the network perimeter. It requires that every user, device, and application be authenticated and authorized before accessing any resource.

How does blockchain enhance cybersecurity?

Blockchain can enhance cybersecurity in several ways:

  • Decentralization: Makes it more difficult for attackers to compromise the system.
  • Immutability: Once data is written to the blockchain, it cannot be changed, which helps to ensure data integrity.
  • Transparency: All transactions on the blockchain are public, which can help to prevent fraud.

What are common methods of authentication and authorization?

Authentication: The process of verifying the identity of a user. Common methods include:

  • Passwords
  • Biometrics (e.g., fingerprint, face scan)
  • Multi-factor authentication (MFA)

Authorization: The process of granting a user access to specific resources. Common methods include:

  • Role-based access control (RBAC)
  • Access control lists (ACLs)