Top Interview Questions for Secure SDLC 2025 | Beginners
Secure Software Development Interview Questions for Beginners is a section dedicated to helping you understand the interviewer’s expectations of a rookie software engineer. Here, you’ll find simple interview questions and detailed answers that focus on key security principles such as cryptography, attack types, and confidentiality, integrity, and availability (CIA). Whether you’re new to secure software development or preparing for your first technical interview, this section provides the information you need.

Q1: What is the difference between Encoding and Decoding in context of data processing?
Encoding and decoding are different processes used to convert data from one representation to another. However, they serve different purposes and operate in different contexts.
Encoding: Encoding refers to the process of converting data from its original format into a different format or representation. The purpose of encoding is to ensure that the data can be transmitted, stored, or processed correctly in a specific system or context. Encoding is commonly used in areas such as data transmission, storage, and information processing.
Decoding: Decoding, however, is the process of converting encoded data back into its original form or representation. It is the reverse operation of encoding and allows the interpretation and utilization of the encoded data.
Q2: What is the difference between Encryption and Hashing?
Encryption and hashing are two common cryptographic techniques used to protect data and enhance its security. While they both involve transforming data, they have unique qualities and fulfill various functions/purposes.
Encryption: Encryption is the process of converting plaintext (readable and understandable data) into ciphertext (encoded and indecipherable data) using an encryption algorithm and a cryptographic key. The primary goal of encryption is to ensure confidentiality by preventing unauthorized access to sensitive information such as passwords, credit card numbers etc.
Hashing: Hashing is a one-way mathematical process that converts data of any size into a fixed-length string of characters, known as a hash value or hash code. The primary purpose of hashing is data integrity and verification, ensuring that data remains unchanged and uncorrupted.
Q3: When do you use Encryption and when do you use Hashing. Give examples of applications?
Encryption and hashing are used in different scenarios based on their distinct purposes and characteristics. Encryption and hashing are used in different scenarios based on their distinct purposes and characteristics.
Encryption is used for:
- Securing Communications
- Securing data storage
- File and email encryption
- Database encryption
Hashing is used for:
- Storing passwords
- Data integrity checks
- Digital Signatures
- Data Deduplication
Q4: What is the difference between symmetric and asymmetric cryptography?
Symmetric cryptography and asymmetric cryptography are two fundamental cryptographic techniques used to secure data and communications. They differ in terms of the key management, encryption/decryption processes, and the purposes they serve.
Symmetric Cryptography: Symmetric cryptography, also known as secret key cryptography, employs a single shared key for both encryption and decryption. The same secret key is used by both the sender and receiver to encrypt and decrypt the data.
Asymmetric Cryptography: Asymmetric cryptography, also known as public key cryptography, employs a pair of mathematically related keys: a public key and a private key. The public key is freely available and used for encryption, while the private key is kept secret and used for decryption.
Q5: When do you use Symmetric Cryptography and when do use Asymmetric Cryptography. Give examples?
Symmetric Cryptography is used for:
- Fast Data Encryption: For encrypting large amounts of data quickly.
- Secure Internal Communication: When a secure channel for key exchange is already established.
Examples:
- AES (Advanced Encryption Standard): Used for encrypting files and storage systems.
- 3DES (Triple DES): Used in financial transactions like ATM operations.
Asymmetric Cryptography is used for:
- Secure Key Exchange: To exchange symmetric keys over insecure channels.
- Digital Signatures: To verify authenticity and integrity of messages or software.
Examples:
- RSA: Used for secure data transmission and digital signatures.
- ECC (Elliptic Curve Cryptography): Used for secure communication with smaller key sizes.
Combined Use Example
HTTPS (Secure Web Browsing): Uses asymmetric cryptography to exchange a symmetric session key, which is then used to encrypt data during the session.
Q6: What is the difference between Authentication and Authorization?
Authentication and authorization are two distinct concepts in the realm of security and access control. While they are related and often used in conjunction, they serve different purposes and address different aspects of controlling access to resources.
Authentication:
- Authentication is the process of verifying the identity of a user or entity attempting to access a system, network, or resource.
- It ensures that the claimed identity is genuine, and that the user is who they claim to be.
- Authentication is typically performed during the initial stages of a user’s interaction with a system to establish trust and grant access rights.
Authorization:
- Authorization, also known as access control, is the process of granting or denying specific privileges or permissions to an authenticated user or entity.
- Once a user’s identity has been established through authentication, authorization determines what actions the user is allowed to perform and what resources they can access within the system.
Q7:What is a Base64 encoding?
Base64 encoding is a binary-to-text encoding scheme that converts binary data into an ASCII character set. It is commonly used to encode binary data, such as images, audio files, or other binary files, into a plain text format.
The term “Base64” indicates that each binary triplet is represented by four ASCII characters.
In the Base64 encoding scheme:
Character Set – The character set used includes 64 different characters. The characters typically used are A-Z (26), a-z (26), 0-9 (10), and ‘+’ and ‘/’ as the last two characters. Additionally, the ‘=’ character may be used for padding purposes.
Encoding Process – The encoding process takes every three bytes (24 bits) of binary data and divides them into four 6-bit groups. Each 6-bit group corresponds to a character in the Base64 character set. If the input binary data is not a multiple of 3 bytes, padding is added to make it a multiple of 3. The ‘=’ character is used for padding.
Example:
As an example, consider the ASCII character ‘A,’ which has a binary representation of 01000001. In Base64 encoding, this binary data would be split into two 6-bit groups: 010000 and 010001. These two groups correspond to the Base64 characters ‘Q’ and ‘U,’ respectively. Therefore, ‘A’ in Base64 is ‘QU.’
Original String:ย Hello, World!
Binary Representation: 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01010111 01101111 01110010 01101100 01100100 00100001
Base64 Encoding:ย SGVsbG8sIFdvcmxkIQ==
Use Cases – Base64 encoding is commonly used in various applications, such as email attachments, data URI schemes in web development, and cryptographic applications. It is also used when data needs to be transmitted in a text-based format that may not reliably preserve binary data.
Decoding – To retrieve the original binary data from a Base64-encoded string, a decoding process is used. The decoding process takes four Base64 characters and converts them back into three bytes of binary data. This process is reversible, and the original binary data can be accurately reconstructed from the Base64-encoded representation.
Note: Base64 encoding is not a method for encrypting data; it is simply a way to represent binary data in a text format. The encoded data is easily reversible, and it does not provide any security or confidentiality on its own.
Q8: What is URL Encoding and where is it used mostly?
- URL encoding is a method used to represent special characters and non-alphanumeric characters in a URL.
- It involves replacing reserved and unsafe characters with a “%” followed by their hexadecimal ASCII code.
- URL encoding ensures that data can be safely transmitted in URLs without causing parsing errors or misinterpretations by web browsers and servers.
Common use cases include encoding spaces as “%20” and special characters, such as “&” or “=”, to prevent confusion with common URL characters.
a trusted third party, known as a Certificate Authority (CA). Digital certificates play a crucial role in ensuring the authenticity, integrity, and confidentiality of digital information in various online interactions, including secure websites, email communication, and software distribution.
Q1: Name some Symmetric key encryption algorithms you are familiar with?
Symmetric key encryption algorithms use the same key for both encryption and decryption.
Here are some well-known symmetric key encryption algorithms:
- AES (Advanced Encryption Standard) – widely adopted and considered highly secure, AES supports key sizes of 128, 192, or 256 bits.
- DES (Data Encryption Standard) – A classic symmetric encryption algorithm now considered insecure for most applications due to its short key length (56 bits).
- 3DES (Triple DES) – An enhancement to DES that applies the DES algorithm three times using two or three different keys, providing a stronger level of security.
- Blowfish – Designed as a fast and secure algorithm with variable key lengths (32 to 448 bits), Blowfish is often used in cryptographic software and protocols.
- Twofish – A symmetric key block cipher designed as an alternative to AES, Twofish supports key sizes of 128, 192, or 256 bits.
- IDEA (International Data Encryption Algorithm) – A block cipher with a 128-bit key that was widely used in the past but is now considered less secure compared to modern algorithms like AES.
When choosing a symmetric key encryption algorithm, it’s important to consider factors such as key size, algorithm strength, and suitability for the specific security requirements of the application or system.
AES is currently the most widely recommended and adopted symmetric encryption algorithm.
Q2: Name some Asymmetric encryption/Public Key Cryptography algorithms you are familiar with?
Asymmetric key encryption algorithms use a pair of keys, namely a public key and a private key, for encryption and decryption.
Here are some well-known asymmetric key encryption algorithms:
- RSA (Rivest-Shamir-Adleman) – One of the earliest and most widely used asymmetric encryption algorithms. RSA is commonly used for securing communications, digital signatures, and key exchange.
- DSA (Digital Signature Algorithm) – Designed for digital signatures, DSA is commonly used in conjunction with other algorithms for secure communication and authentication.
- ECDSA (Elliptic Curve Digital Signature Algorithm) – A variant of DSA that uses elliptic curve cryptography, providing similar security with shorter key lengths, making it more efficient.
- Diffie-Hellman (DH) – Primarily used for key exchange, Diffie-Hellman enables two parties to securely agree on a shared secret key over an untrusted network.
- ECDH (Elliptic Curve Diffie-Hellman) – An elliptic curve variant of Diffie-Hellman, ECDH is used for secure key exchange in a more efficient manner compared to traditional Diffie-Hellman.
- ElGamal – Named after its inventor Taher ElGamal, this algorithm is used for public-key encryption and digital signatures. It is often used in key exchange protocols.
- DSA-ElGamal (DSS) – Combining the Digital Signature Algorithm (DSA) and ElGamal, this algorithm is part of the Digital Signature Standard (DSS).
- RSA-OAEP (Optimal Asymmetric Encryption Padding) – A padding scheme used with RSA for secure encryption, preventing certain types of attacks.
- Curve25519 – A specific elliptic curve that is gaining popularity for its efficiency and security properties. It is often used in protocols like TLS for key exchange.
These algorithms serve different purposes within the realm of asymmetric cryptography, including secure communication, digital signatures, and key exchange.
The choice of algorithm depends on factors such as security requirements, key size, and computational efficiency.
Q3: Name some hashing algorithms you are familiar with & what is the recommended modern hashing algorithm:
Hashing algorithms are used to produce a fixed-size hash value (digest) from input data of any size. Here are some well-known hashing algorithms:
- MD5 (Message Digest Algorithm 5) –Produces a 128-bit hash value. MD5 is widely used but considered insecure for cryptographic purposes due to vulnerabilities.
- SHA-1 (Secure Hash Algorithm 1) – Produces a 160-bit hash value. Like MD5, SHA-1 is deprecated for cryptographic use due to vulnerabilities, and more secure alternatives are recommended.
- SHA-256, SHA-384, and SHA-512 (Secure Hash Algorithms 256, 384, and 512) – Part of the SHA-2 family, these algorithms produce hash values of 256, 384, and 512 bits, respectively. They are currently considered secure and widely used for various cryptographic purposes.
- SHA-3 (Secure Hash Algorithm 3) – Introduced as the latest member of the Secure Hash Algorithm family, SHA-3 is not an extension of SHA-2. It provides hash values of various lengths, and its design is based on different principles than SHA-2.
- Whirlpool – A cryptographic hash function producing a 512-bit hash value. It is designed to offer strong security and resistance to various attacks.
- HMAC (Hash-based Message Authentication Code) – While not a standalone hash function, HMAC is a construction that uses a hash function (such as MD5, SHA-1, or SHA-256) in combination with a secret key to provide message authentication.
When choosing a hashing algorithm, it’s essential to consider factors such as security strength, collision resistance, and the specific use case.
For cryptographic purposes, it’s generally recommended to use the SHA-2 or SHA-3 family of algorithms, depending on the specific security requirements.
Q4: What is a vulnerability in the context of information security?
A vulnerability, in the context of information security, refers to a weakness or a flaw in a system, software, network, or process that could be exploited by an attacker to compromise the confidentiality, integrity, or availability of the system or its data.
Vulnerabilities can exist at various levels, including software, hardware, network configurations, or human factors, and they can arise due to design flaws, coding errors, misconfigurations, or other factors.
Q5: What do you know about confidentiality, integrity, and availability?
Confidentiality, integrity, and availability (often abbreviated as CIA) are the three core principles of information security that form the foundation for designing and implementing secure systems.
Here’s a brief overview of each:
Confidentiality โConfidentiality ensures that information is accessible only to those who are authorized to access it.
Objective: Protect sensitive data from unauthorized access or disclosure.
Examples: Encryption, access controls, and secure communication channels are measures that help maintain confidentiality.
Integrity โ Integrity ensures that information remains accurate, consistent, and unaltered during storage, processing, or transmission.
Objective: Prevent unauthorized modification or tampering of data.
Examples: Hash functions, digital signatures, and version controls are mechanisms that help maintain data integrity.
Availability โ Availability ensures that information and system resources are accessible and usable by authorized users when needed.
Objective: Ensure that systems are operational and that services are available to users.
Examples: Redundancy, backups, and disaster recovery planning are strategies that contribute to maintaining availability.
These three principles collectively help create a secure environment for information systems. The goal is to strike a balance between them based on the specific needs and risks of a given system or organization. This balance is often referred to as the “security triad” and is a fundamental concept in the field of information security.
Q6: How does HTTPS make a website secure?
- HTTPS (Hypertext Transfer Protocol Secure) ensures the security of a website through encryption and authentication. It encrypts data exchanged between a user’s browser and the website’s server, preventing unauthorized access to sensitive information.
- HTTPS also uses digital certificates to verify the identity of the website, protecting against impersonation. This secure communication helps maintain data integrity, prevents tampering, and safeguards user privacy.
- Browser indicators, such as a padlock icon, signal the use of HTTPS, instilling confidence in users that their interactions with the website are protected and trustworthy.
Q7: What is an SSL certificate and what isย its purpose?
An SSL certificate is a digital certificate that authenticates the identity of a website and enables secure, encrypted communication between the user’s web browser and the website’s server.
It plays a key role in ensuring data privacy, integrity, and user trust on the internet by confirming the legitimacy of the website and encrypting information exchanged during online transactions.
The presence of an SSL certificate is often indicated by a padlock icon in the browser’s address bar and a URL starting with “https://” instead of “http://”.
Q8: What happens when an application takes user inserted data and sends it to a web server without proper validation and escaping?
When an application accepts user-inserted data to a web server without proper validation and escaping following issues might arise:
- Security Vulnerabilities – The application becomes vulnerable to security threats, including injection attacks such as SQL injection, Cross-Site Scripting (XSS), or other code injection exploits.
- Data Manipulation – Malicious users can manipulate the data input to execute unintended actions on the server, potentially leading to unauthorized access, data breaches, or service disruptions.
- Code Execution – Lack of validation and escaping may allow attackers to inject and execute arbitrary code on the server, compromising the integrity of the application and posing risks to both data and system resources.
- Cross-Site Scripting (XSS) – Without proper validation, user-inserted data might contain malicious scripts that, when executed on other users’ browsers, can steal sensitive information, or perform actions on behalf of the affected users.
- SQL Injection – Inadequate validation leaves the door open for SQL injection attacks, where attackers can manipulate database queries, potentially gaining unauthorized access to sensitive data or performing malicious operations on the database.
- Security Breaches – The lack of validation and escaping can lead to security breaches, compromising user confidentiality, system integrity, and overall application security.
- User Privacy Risks – Users’ sensitive information, if not properly validated and protected, may be exposed to unauthorized individuals, leading to privacy violations and potential legal consequences.
- Application Compromise – The overall security and stability of the application are at risk, as attackers can exploit vulnerabilities to compromise the functionality of the application or gain control over the hosting server.
- Reputation Damage – Security vulnerabilities resulting from inadequate data validation can lead to a compromised reputation for the application or organization, eroding user trust and confidence.
To mitigate these risks, it is crucial to implement proper input validation, data sanitization, and escaping techniques in web applications to ensure that user input is safe, and potential security vulnerabilities are minimized.
Q9: What is SQL Injection? How do you mitigate the SQL Injection risks?
SQL Injection is a type of cyber-attack where malicious SQL code is injected into input fields of a web application, exploiting vulnerabilities in the application’s handling of user-input data. This can lead to unauthorized access, manipulation, or retrieval of data from a database.
Mitigation of SQL Injection Risks:
- Use Parameterized Statements- Utilize parameterized queries or prepared statements in your code. This ensures that user input is treated as data, not executable code, preventing SQL injection.
- Input Validation – Implement strict input validation to ensure that user input adheres to expected formats and types. Reject input that doesn’t meet the criteria.
- Least Privilege Principle – Limit database user privileges. Ensure that database accounts used by the application have the minimum necessary permissions to reduce the potential impact of a successful SQL injection attack.
- Web Application Firewalls (WAF) – Employ WAFs to monitor and filter HTTP traffic between a web application and the internet. WAFs can help detect and block SQL injection attempts.
- Stored Procedures – Use stored procedures for database access. This can help abstract SQL logic and reduce the risk of injection by separating code from user input.
- ORMs (Object-Relational Mapping) – Consider using ORM frameworks that automatically handle SQL queries. ORM frameworks often parameterize queries, reducing the likelihood of SQL injection vulnerabilities.
- Escape User Input – If dynamic SQL is unavoidable, escape user input by using proper escaping functions provided by the programming language or database library. This ensures that special characters are treated as literals.
- Regular Security Audits – Conduct regular security audits and code reviews to identify and address potential SQL injection vulnerabilities. Automated tools can assist in identifying common patterns associated with SQL injection.
- Educate Developers – Educate developers about secure coding practices, especially regarding input validation and the risks associated with SQL injection. Awareness is key to preventing vulnerabilities.
- Database Security Best Practices – Implement database security best practices, such as strong authentication, encryption of sensitive data, and regular security updates, to fortify the overall security posture.
By adopting a combination of these measures, organizations can significantly reduce the risk of SQL injection attacks and enhance the security of their web applications.
Q10: What is DDOS attack?
A Distributed Denial of Service (DDoS) attack is a malicious attempt to disrupt the regular functioning of a website, service, or network by overwhelming it with a massive volume of traffic from multiple sources, making it inaccessible to legitimate users. The goal is to exhaust the target’s resources and cause a denial of service.
Q11: What is SSO?
SSO, or Single Sign-On, is an authentication process that allows a user to access multiple applications or services with a single set of login credentials (username and password).
The primary goal of SSO is to simplify and streamline the user experience by eliminating the need for users to remember and enter separate credentials for each application.
In a typical SSO scenario:
Step1: User Authentication – The user logs in once with their credentials (username and password) to a central identity provider or authentication system.
Step2: Token Issuance – After successful authentication, the identity provider issues a secure token or session identifier.
Step3: Token Usage – The user presents this token to access other connected applications or services without needing to re-enter credentials.
Step4: Access to Multiple Applications– The token serves as proof of authentication, granting the user access to various applications within the SSO ecosystem.
Benefits of Single Sign-On:
- Convenience – Users only need to remember and enter one set of credentials, simplifying the login process and reducing password fatigue.
- Efficiency – SSO enhances productivity by reducing the time spent logging in and out of multiple applications.
- Security – SSO can improve security by enforcing centralized policies, ensuring consistent authentication methods, and facilitating easier management of user access.
- Centralized Management – Administrators can centrally manage user access, permissions, and security policies, leading to better control over the entire authentication process.
- User Experience – SSO improves the user experience by providing a seamless and integrated login process across various applications, promoting user satisfaction.
- Reduced Helpdesk Load – Since users are less likely to encounter login issues, the helpdesk workload related to password resets and account lockouts is reduced.
Common SSO Protocols and Standards:
- SAML (Security Assertion Markup Language) – A standard for exchanging authentication and authorization data between parties, particularly in web browser single sign-on scenarios.
- OAuth (Open Authorization) – A framework that enables third-party applications to obtain limited access to a user’s resources without exposing credentials.
- OpenID Connect – An identity layer on top of OAuth 2.0, providing a standard for authentication and representing user identity information.
In summary, SSO simplifies the authentication process by allowing users to access multiple applications with a single set of credentials, providing efficiency, convenience, and improved security.
Q12: What is a digital certificate?
A digital certificate is a cryptographic credential that verifies the identity of an entity (such as a person, device, or website) and is used to establish secure communication or transactions over a network. It contains information about the entity, including its public key, and is issued by a trusted third party, known as a Certificate Authority (CA). Digital certificates play a crucial role in ensuring the authenticity, integrity, and confidentiality of digital information in various online interactions, including secure websites, email communication, and software distribution.
Also read: Interview Questions for Seniors, Interview Questions for Leaders