Assignment ASHUTOSH
Assignment ASHUTOSH
System.out.println("Authentication successful.Welcome,user");
} else {
® In above given insecure java program, the UserID & Passcode is hard-
coded in the source code, which is a security vulnerability.
®Additionally ,sensitive information is being read from the console input directly without
any encryption or protection.
import java.util.Scanner;
public class SecureSignInAuthentication {
if (authenticateUser(inputUserID, inputPasscode)) {
} else {
// For this example, we'll use a simple MD5 hash (for illustrative purposes only).
return MD5HashFunction.hash(password);
return org.apache.commons.codec.digest.DigestUtils.md5Hex(input);
Secure Aspects :
Dynamic Credentials:
The dynamically compared values takes place of hard-coded credentials. All of this would be fetched
from a secure database in a real application.
2. How to model cryptography in Secure Software Engineering
perspective?
1.Analisis of Requirement: This contains about the security requirements of the software and
identification of protective data. Level of desired security such as – data encryption, authentication
and digital signature also determined in this step.
2.Selection of suitable Techniques for cryptography: Select cryptographic algorithms and protocols
which aligns with the standards of security requirements. For example- AES for encryption ,HMAC for
integrity of messages.
3.Key management: In this step of modelling cryptography we need to develop a key management
strategy for generating , storing , distributing and revoking the cryptographic keys securely.
4.Secure Design of Architecture: In this step user need to follow layered architecture approach to
separate security concerns from application logic.
5.Secure data transmission: Important thing is to secure data transmitted over networks using
encryption protocols like TLS/SSL. Here one also maintain the implementation of proper
management of certificate and validation processes.
6.Store The Data securely: In this step one needs to encrypt the data before storing it on the disk or
in any database. Access control and authorization mechanism will be used to ensure that only
authorized persons can access the encrypted data.
7.Message Integrity: Use cryptographic techniques like- Hash based Message Authentication code
(HMAC) to ensure the integrity of message and tampering detection.
8.Digital Signatures: Implement digital signature in the cryptography modelling which helps to
provide data authenticity. Asymmetric cryptography will generate and verify the digital signatures.
9.Secure code practices: Secure coding practices will be followed to avoid vulnerabilities like – timing
attacks and side channel attacks.
10.Security testing & Validation: Use tools to identify security vulnerabilities and analyse the codes.
11.Continuos Review And maintenance monitoring: It is most important to keep the cryptography
well and secured by taking a time to time monitoring and review and if required maintain
accordingly.
12.Documentation: Document all the inclusive approaches like – design decisions, security measures
and key management procedures in place for any possible future reference and auditing.