Posts

Modular JavaScript Architecture

Image
Enterprise software of the modern business world are becoming more critical due to the competitive edge they bring to organizations. Leading businesses continuously invest money to sustain their competitive advantage by improving and addressing deficiencies in their existing software platforms. The demand for business-critical change and improvement in enterprise software often causes code deterioration and accidental production of bugs which led developers in search of architectures that can withstand future changes. Thus, giving birth to modular architectures. Modular JavaScript Architectures A high level diagram of Modular JavaScript Architectures. The Modular JavaScript Architecture (MJA) was introduced to build modern web applications that can withstand future changes without deteriorating. It also reduces the probability of bug introductions caused by change to existing softw...

How HTTP 2.0 affects existing web optimizations

Image
Today's blog post would focus on how HTTP 2.0 affected web optimization techniques that were dominantly used in the HTTP 1.1 era. HTTP 2.0 - An Insurgence HTTP 2.0 was proposed by Google to improve the overall performance of web transactions. The thing that triggered the need for HTTP 2.0 is the significant gap between the growth of bandwidth capacity of networks and web page load times. HTTP 1.1 based browsers can only support six concurrent resource download on each domain. On the graph above, you would notice that the latency of clients with 5 Mbps network bandwidths and above don't get significant performance gains as compared to the clients on the left side of the graph. The decline on latency improvement as bandwidth capacity grows is generally blamed to the fact that HTTP 1.1 implementation of browsers can only download six resources per domain co...

Risks associated with plain text passwords

Image
Today's blog post would be about why storing passwords in plain text is a bad practice. We would be identifying vulnerabilities associated with this type of password management. This would be the pilot post among a series of blog postings regarding ethical and secure authentication systems. How user authentication travels For us to be capable of identifying the risks and threats associated with plain text passwords, we have to get a little background on how password travels from a client application (web, desktop or mobile) to the server. The diagram below describes the typical flow used by a client application to verify a user's authentication data. The diagram above shows how most authentication systems are implemented. Listed below are the steps associated with this authentication process: Password is provided by the user to the client applic...

Security: HTTP headers that expose web application / server vulnerabilities

Image
Today's blog post will cover how ASP.net response HTTP headers can expose security holes in your web application and servers. The post will also contain steps on how to remove this headers and mitigate chances of getting attacked using C# and ASP.net MVC. Problem When an attacker performs an attack on a web server, the first thing he /she needs to do is to identify the profile of his target. To profile a target web application / server, an attacker would have to perform the following steps: Identify the address of the web application. Identify the OS where the web application resides Identify the type of server (IIS, Apache, etc) that was hosting the web application Identify the frameworks (ASP.net MVC, PHP, JSF) used by the applications After an attacker gathers the following information, the attacker would proceed on using penetration to...

Validating balanced parenthesis, brackets and braces inside a mathematical equation.

Image
Today, I will try to create a C# method that would validate if the brakcets, parenthesis and braces of a given mathematical equation is properly written, balanced and complete. The goal of this excercise is to utilize the stack data structure to write an algorithm with a linear growth. Any suggestions on how to do this using logarithmic algorithms are welcome. The method should return true for the following inputs: (x + y) - ((z * y) + x) {(1 / 2) + (y / z)} - ([g + z]) - (x + y) [x + y] - (5 * x) The method should return false for the following inputs: (x + 3] {(y + z)] (x + y) + [g(5])] Solution Clone it from GitHub Below is a class that validates if the brackets, parenthesis and curly braces of a formula are properly written and has a counterpart. ...

JavaScript Short Circuiting

Today, I'll be discussing the unorthodox and not so familiar JavaScript idiom called Short Circuit (&& and ||). As developers, most of us have been taught on the popular use of the Logical AND and OR operators since our college days. Some might even learned it at the age of three! Back to Basics We need to revisit the basic usage of these operators before tackling short-circuiting in JavaScript. For additional information regarding JavaScript Logical AND and OR operators, Please visit the following links: W3 Schools Mozilla Documentation Logical AND Operator (&&) The AND operator (&&) is used to evaluate if both of its operands are true. If both of its operands are true, then it returns true . Otherwise, then it returns false . Example var x = 1, y = 2; console.log(x == 1 && y == 2);//returns true console.log...