Crypt and Code Review
Crypt and Code Review
of understanding how they work and finding and improving techniques for
defeating or weakening them. For example, cryptanalysts seek to decrypt
ciphertexts without knowledge of the plaintext source, encryption key or the
algorithm used to encrypt it; cryptanalysts also target secure hashing, digital
signatures and other cryptographic algorithms.
For example, a cipher with a 128 bit encryption key can have 2 128 (or
340,282,366,920,938,463,463,374,607,431,768,211,456) unique keys; on
average, a brute force attack against that cipher will succeed only after trying
half of those unique keys. If cryptanalysis of the cipher reveals an attack that
can reduce the number of trials needed to 2 40 (or just 1,099,511,627,776)
different keys, then the algorithm has been weakened significantly, to the point
that a brute-force attack would be practical with commercial off-the-shelf
systems.
Cryptanalysts commonly use many other data security tools including network
sniffers and password cracking software, though it is not unusual for
cryptanalytic researchers to create their own custom tools for specific tasks and
challenges.
Ideally, such tools would automatically find security flaws with a high degree of
confidence that what is found is indeed a flaw. However, this is beyond the state
of the art for many types of application security flaws. Thus, such tools
frequently serve as aids for an analyst to help them zero in on security relevant
portions of code so they can find flaws more efficiently, rather than a tool that
simply finds flaws automatically.
Some tools are starting to move into the Integrated Development Environment
(IDE). For the types of problems that can be detected during the software
development phase itself, this is a powerful phase within the development
lifecycle to employ such tools, as it provides immediate feedback to the
developer on issues they might be introducing into the code during code
development itself. This immediate feedback is very useful as compared to
finding vulnerabilities much later in the development cycle.
The UK Defense Standard 00-55 requires that Static Code Analysis be used on
all ‘safety related software in defense equipment’.[0]
Techniques
There are various techniques to analyze static source code for potential
vulnerabilities that maybe combined into one solution. These techniques are
often derived from compiler technologies.
Data flow analysis is used to collect run-time (dynamic) information about data
in software while it is in a static state (Wögerer, 2005).
There are three common terms used in data flow analysis, basic block (the
code), Control Flow Analysis (the flow of data) and Control Flow Path (the path
the data takes):
$a = 0;
$b = 1;
if ($a == $b)
{ # start of block
echo “a and b are the same”;
} # end of block
else
{ # start of block
echo “a and b are different”;
} # end of block
Control Flow Graph (CFG)
Example Control Flow Graph; ‘node 1’ represents the entry block and ‘node 6’
represents the exit block.
Taint Analysis
Taint Analysis attempts to identify variables that have been ‘tainted’ with user
controllable input and traces them to possible vulnerable functions also known
as a ‘sink’. If the tainted variable gets passed to a sink without first being
sanitized it is flagged as a vulnerability.
Some programming languages such as Perl and Ruby have Taint Checking built
into them and enabled in certain situations such as accepting data via CGI.
Lexical Analysis
T_OPEN_TAG
T_VARIABLE
=
T_CONSTANT_ENCAPSED_STRING
;
T_CLOSE_TAG
Strengths and Weaknesses
Strengths
Scales Well (Can be run on lots of software, and can be repeatedly (like in
nightly builds))
For things that such tools can automatically find with high confidence,
such as buffer overflows, SQL Injection Flaws, etc. they are great.
Weaknesses
Limitations
False Positives
A static code analysis tool will often produce false positive results where the
tool reports a possible vulnerability that in fact is not. This often occurs because
the tool cannot be sure of the integrity and security of data as it flows through
the application from input to output.
False Negatives
The use of static code analysis tools can also result in false negative results
where vulnerabilities result but the tool does not report them. This might occur
if a new vulnerability is discovered in an external component or if the analysis
tool has no knowledge of the runtime environment and whether it is configured
securely.
Cyber defense is all about giving an entity the ability to thwart cyber
attacks on-the-go through cyber security . It involves all processes and
practices that will defend a network, its data, and nodes from
unauthorized access or manipulation. The most common cyber
defense activities include:
This gives cyber security a deterrent approach. All your client will
need is assurance that he or she can conduct business without
worrying about the ever-growing cyber threats.
Common Roles in Cyber Security:
Security Architects
Security architects analyze existing protective measures and
recommend better ways to protect systems. The security architect
might take things a step farther and design software, hardware, and
policies needed to implement the proposed security system.
Penetration Testers
Penetration testers are "white hat hackers," who simulate real hacks
with the sole purpose of identifying vulnerabilities in a security
system.
Forensics Experts
Forensic experts come in when systems fail and hackers gain access
to critical data. The forensic expert will identify how the intruders
made their way in and use this data to track down the perpetrators or
recommenced future system patches.