Thursday 28 May 2015

Google Maps will soon include offline search and navigation

In keeping with Sundar Pichai's grand theme of services available to all, Google is today announcing offline search in its Maps application along with offline turn-by-turn voice navigation instructions. Aimed to help users in developing countries where access to data is either spotty, expensive, or both, the new features will let people use Google's services even when they don't have "super reliable connectivity." The new offline functionality is coming to Google Maps later this year, joining the YouTube Offline option (available in India, Indonesia, the Philippines, and Vietnam) that allows you to download and keep YouTube videos on your device for up to 48 hours. And just to round things off, Google's making big strides in optimizing data usage in its Chrome web browser as well, claiming it can now reduce data consumption by as much as 80 percent.

Wednesday 27 May 2015

Report

Obfuscation



Definition:
Obfuscation is the obscuring (hiding) of intended meaning in communication, making the message confusing, ambiguous or harder to understand.

Software Obfuscation:
In software development, Obfuscation is the deliberate act of creating obfuscated code, e.g. source or machine code that is hard to understand. Programmers may obfuscate code for security or to secure its logic, in order to prevent reverse engineering, tampering or recreational.

Android tool:
ProGuard is the tool use in android for obfuscation. The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security like when you are Licensing Your Applications.
ProGuard is integrated into the Android build system, so you do not have to invoke it manually. ProGuard runs only when you build your application in release mode, so you do not have to deal with obfuscated code when you build your application in debug mode. Having ProGuard run is completely optional, but highly recommended.

Some uses of ProGuard:
  • Creating more compact code, for smaller code archives, faster transfer across networks, faster loading, and smaller memory footprints.
  • Making programs and libraries harder to reverse-engineer.
  • Listing dead code, so it can be removed from the source code.
  • Retargeting and pre-verifying existing class files for Java 6 or higher, to take full advantage of their faster class loading.


References:

Tuesday 26 May 2015

9 Mind-Blowing Inventions That You Did Not Know Were Made By Pakistanis

Pakistanis are pure genius... We just don't say it, we can prove it. Here is the list of some of the amazing inventions made by Pakistanis, followed/ practiced/ used by people around the globe.

1. Fertilizers With Non-Explosive Materials

Recently a Pakistani fertilizer company invented a new formula to make fertilizers that cannot be converted into bomb-making materials. Previously, fertilizers with ammonium nitrate, were easily converted into bomb-making ingredients.

2. Successful Brain-Silicon Chip Connection

Dr. Naweed Syed is the first scientist who managed to "connect brain cells to a silicon chip". This Pakistani helped the world achieve a great milestone. This discovery will significantly help in the research of integrating computers with the human brains in order to assist people monitor vital signs control artificial limbs, correct memory loss or vision impairment.

3. Sagar Veena

The Sagar Veena, use in classical music, was developed completely in Pakistan over the last 40 years by Raza Kazim at the Sanjannagar Institute, Lahore.

4. Human Development Index

Pakistani economist Mahbub ul Haq devised the Human Development Index in 1990 in order to move the focus of development economics to people centered policies from national income accounting.

5. Lavatory That Transforms Human Waste into Charcoal, Minerals, And Clean Water

Pakistani researcher at Loughborough University, Sohail Khan designed a  lavatory that converts human waste into biological charcoal, which can be burned, and clean water.

6. (c) Brain, One Of The First Computer Viruses

This virus was created by the Farooq Alvi Brothers in 1986 in Lahore, Pakistan to discourage piracy of the software they had made.

7. The Ommaya Reservoir

Ommaya_01
Developed by Ayub K. Ommaya, the Ommaya reservoir is a system used for injecting the medicines into the cerebrospinal fluid for treatment of patients with brain tumours.

8. Pleuroperitoneal Shunt, Endotracheal Tube

202-1463-1-PB
A Pakistani American doctor from Peshawar, Pakistan invented the Pleuroperitoneal Shunt and a Special Endotracheal Tube tube to supply oxygen during fiber-optic bronchoscopy in awake patients.

9. A Software Simulation To Reduce Death Rate In Bomb Blast

011-640x480
A Pakistani computer scientist, Zeeshan-ul-Hassan Usmani, has introduced a Software simulation based on blast forensics designed by that claims to reduce deaths (on average) by 12% and injuries by 7% merely by altering the way a group of people stand near an expected suicide bomber.

Cryptography - Famous Encryption Techniques

Brief Report

Encryption methods

1.     Symmetric vs. Asymmetric Encryption

There are two basic techniques for encrypting information: symmetric encryption (also called secret key encryption) and asymmetric encryption (also called public key encryption.)

Symmetric Encryption

Symmetric encryption is the oldest and best-known technique. A secret key, which can be a number, a word, or just a string of random letters, is applied to the text of a message to change the content in a particular way. This might be as simple as shifting each letter by a number of places in the alphabet. As long as both sender and recipient know the secret key, they can encrypt and decrypt all messages that use this key.

Asymmetric Encryption

The problem with secret keys is exchanging them over the Internet or a large network while preventing them from falling into the wrong hands. Anyone who knows the secret key can decrypt the message. One answer is asymmetric encryption, in which there are two related keys--a key pair. A public key is made freely available to anyone who might want to send you a message. A second, private key is kept secret, so that only you know it. 

Symmetric vs. Asymmetric

Symmetric
Asymmetric
 Symmetric encryption uses the identical key to both encrypt and decrypt the data. 
Asymmetric encryption uses two related keys (public and private) for data encryption and decryption.
Security risks.
Takes away the security risks.
Exposed key.
The private key is never exposed.
Much faster computationally than asymmetric algorithms as the encryption process is less complicated.
Little complicated than symmetric.
 Key is transferred with encrypted data to decrypt data.
Public key is exposed and other user knows the private key.




2.     RSA (Rivest-Shamir-Adleman) - Asymmetric

RSA is a cryptosystem for public-key encryption, and is widely used for security sensitive data, particularly when being sent over an insecure network such as internet.
It is also known as asymmetric cryptography. It has two keys a public key and a private key. The public key can be shared with anyone whereas private key must be kept secret. When encrypting the message, it is raised to the power of the key, and divided with remainder by a fixed product of two primes. By repeating the process with the other key, the plaintext can be retrieved back.

3.     AES (Advanced Encryption Standard) - Symmetric

It is a software and hardware tool to encrypt and decrypt text using AES encryption algorithm. You can chose 128, 192 or 256-bit long key size for encryption and decryption.
AES comprises three block ciphers, AES-128, AES-192 and AES-256. Each cipher encrypts and decrypts data in blocks of 128 bits using cryptographic keys of 128, 192 and 256-bits, respectively. Symmetric or secret-key ciphers use the same key for encrypting and decrypting, so both the sender and the receiver must know and use the same secret key.

4.     RSA vs. AES

RSA is an asymmetric cipher. It is ideal for secure exchange of messages across an untrusted network, because the public key can be known by everyone - a message encrypted with the public key can only be decrypted by the private key. As such, if two parties know each other's public keys, they can exchange messages securely. This means that no secret information has to be transmitted - as long as authenticity and integrity are maintained you're safe. Thankfully, RSA provides a method of generating signatures on data, which help prove that it is authentic. Given a message signed by a private key, it is possible to verify that signature using the corresponding public key.
As a rule of thumb, you can only encrypt data as large as the RSA key length. So, if you've got a 4096-bit RSA key, you can only encrypt messages up to 4096 bits long. Not only that, but it's incredibly slow. RSA isn't designed as a full-speed data transport cipher. RSA is much slower.
AES is a symmetric block cipher, and is incredibly fast. The plaintext is split into chunks called blocks, and each block is encrypted in a chain. There are different ways of doing this, but a common one is called Cipher Block Chaining, or CBC for short. This allows for theoretically infinite message sizes. However, symmetric ciphers like AES require a secret key to be exchanged first. Unlike RSA, the shared key must remain unknown to attackers, so you have to provide authenticity, integrity, and secrecy. That's difficult to do directly.




References:

BAR Codes & QR Codes

Report

1D & 2D BARCODE

DEFINITION
A barcode is an optical machine/computer readable representation of data relating to the object to which it is attached. A 1D (linear) code is the typical "picket fence" style barcode that people are most familiar with. There are several versions of 1D codes and some encode only numbers while others can encode any keyboard character. All the information in the code is organized horizontally from left to right. These types of codes can be read by any type of barcode scanner. 2D barcodes are a bit more complex as they organize information vertically and horizontally. This allows 2D codes to hold much more information and take up less space than a 1D code. 2D codes require an image scanner to be read properly.

TYPES
One dimensional (1D) barcodes have many different types e.g. Codes 128, Code 39, UPC etc. Whereas two dimensional (2D) also have many types e.g. Data Matrix, PDF417, and QR Code etc.




WORKING
A barcode essentially is a way to encode information in a visual pattern that a machine can read. The combination of black and white bars (elements) represents different text characters which follows a set algorithm for that barcode type. If you change the sequence of elements you get different text. A barcode scanner reads this pattern of black and white that is then turned into a line of text your computer can understand. Usually it has product information like name, type etc. and system matches the product to database and get any required information.
Depending on the specific barcode type, 1D barcodes can have from 20-25 characters while 2D codes go up to 2,000 characters. The main practical concern is that as you increase the amount of information in the barcode the bigger it will become. 


The number of digits is determined by how many products you will need to assign numbers to. So if you have thousands of products, your company prefix will need to be fewer digits. If you have just a few products, your company prefix will likely be closer to 10 digits long. The second component is your unique number used to reference a specific product. It is called an "Item Reference Number.


QR code
QR (quick response) code a machine-readable code also known as 2D barcode consisting of an array of black and white squares, typically used for storing URLs or other information for reading by the camera on a smartphone. Unlike UPC barcode which are horizontal lines, a QR code can be captured more quickly and can contain more information.


QR code are intended to be a quick way to perform an action with your phone. Anyone can make QR code from many different websites like:
And many more.


WORKING
QR codes are made up of black squares and white squares. Each of these squares is called a module. In every QR code, there are certain modules that must not be covered or edited.

·         The three large squares highlighted in red are the position markers. These tell the scanner where the edges of the code are.
·         The smaller red square is an alignment marker. This acts as a reference point for the scanner, making sure everything lines up properly. In bigger codes, there are several of these squares.
·         The red strips of alternating black and white modules are called timing patterns. They define the positioning of the rows and columns.
·         The green sections determine the format. This tells the scanner whether it’s a website, text message, Chinese symbols, numbers, or any combination of these.
·         The modules highlighted in blue represent the version number. Basically, the more modules in the code, the higher the version (up to v40, which is 177×177 modules). If the code is version 6 or smaller, the version does not need to be defined here because the scanner can literally count the modules and determine the version on its own.


·         Now everything else is free for us. Almost all the remaining modules are grouped into 8 modules. These groups are known as bytes, they fit together in the grey area.
·         When a smartphone or scanner reads a QR code, each byte is determined to be either completely readable or completely un-readable. That means that if you change one single module (e.g. turning a black square into a white square), the entire byte containing that module is rendered un-readable.
The table will give you a letter that represents the level of error-correction contained in your code. Here’s what these letters mean:
·         Level L – You can alter up to 7% of the code without ruining its scan-ability. If your code has 154 bytes, you can edit 10 (maybe 11) bytes and it will still scan successfully.
·         Level M – You can alter up to 15% of the code.
·         Level Q – You can alter up to 25% of the code.
·         Level H – You can alter as much as 30% of your code.
So now you should be able to do the following:
-          Generate a QR code
-          Identify the No-Zones
-          Figure out the placement of the bytes
-          Figure out how many bytes you can edit


JAVA API:
Here is the most famous open source java library to generate QR code.


REFERENCES: