2021-01-10
AES vs. DES Encryption: Why Advanced Encryption Standard (AES) has replaced DES, 3DES and TDEA
The time required to crack an encryption algorithm is directly related to the length of the key used to secure the data.

Every so often, we encounter someone still using antiquated DES for encryption. If your organization hasn’t switched to the Advanced Encryption Standard (AES), it’s time for an upgrade. To better understand why: let’s compare DES and AES encryption:

What is AES encryption and how does it work?

When it comes to cyber security, AES is one of those acronyms that you see popping up everywhere. That’s because it has become the global standard of encryption and it is used to keep a significant amount of our communications safe.

The Advanced Encryption Standard (AES) is a fast and secure form of encryption that keeps prying eyes away from our data. We see it in messaging apps like WhatsApp and Signal, programs like VeraCrypt and WinZip, in a range of hardware and a variety of other technologies that we use all of the time.

2021-01-09
How iOS and Android Handle Connections with BLE Human Interface Devices

iOS and Android’s Bluetooth APIs allow apps to communicate with BLE devices. The API simplifies the way apps implement BLE and allows multiple apps to use BLE at the same time, but it also introduces many undocumented behaviors. Unfortunately, the only way to understand these behaviors is through experimentation. The behavior we’ll be focusing on today is how iOS and Android handle reconnecting to disconnected human interface devices.

2020-12-30
Closures in Swift

Closures are self-contained blocks of functionality that can be passed around and used in your code. Closures in Swift are similar to blocks in C and Objective-C and to lambdas in other programming languages.

Closures can capture and store references to any constants and variables from the context in which they are defined. This is known as closing over those constants and variables. Swift handles all of the memory management of capturing for you.

NOTE

Don’t worry if you are not familiar with the concept of capturing. It is explained in detail below in Capturing Values.


Posted by chris on: 2020-12-30, Category: Algorithm

Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.

  1. Always pick first element as pivot.
  2. Always pick last element as pivot (implemented below)
  3. Pick a random element as pivot.
  4. Pick median as pivot.

The key process in quickSort is partition(). Target of partitions is, given an array and an element x of array as pivot, put x at its correct position in sorted array and put all smaller elements (smaller than x) before x, and put all greater elements (greater than x) after x. All this should be done in linear time.

QuickSort

Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.

  1. Always pick first element as pivot.
  2. Always pick last element as pivot (implemented below)
  3. Pick a random element as pivot.
  4. Pick median as pivot.

The key process in quickSort is partition(). Target of partitions is, given an array and an element x of array as pivot, put x at its correct position in sorted array and put all smaller elements (smaller than x) before x, and put all greater elements (greater than x) after x. All this should be done in linear time.


Posted by chris on: 2020-12-30, Category: C++

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, though it is possible to remove and add the modified value of that element. Some basic functions associated with Set:

  • begin() – Returns an iterator to the first element in the set.
  • end() – Returns an iterator to the theoretical element that follows last element in the set.
  • size() – Returns the number of elements in the set.
  • max_size() – Returns the maximum number of elements that the set can hold.
  • empty() – Returns whether the set is empty.
Set in C++ Standard Template Library (STL)

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, though it is possible to remove and add the modified value of that element. Some basic functions associated with Set:

  • begin() – Returns an iterator to the first element in the set.
  • end() – Returns an iterator to the theoretical element that follows last element in the set.
  • size() – Returns the number of elements in the set.
  • max_size() – Returns the maximum number of elements that the set can hold.
  • empty() – Returns whether the set is empty.
2020-12-29
Git Commands Cheat Sheet

Git commands are an essential lesson that every developer needs to master at some point. To use the full potential of Git, the popular version control system, you need to know how to use Git commands.

In this tutorial, you will find all the commonly used Git commands as well as a downloadable cheat sheet.

git init [directory]
git clone [repo / URL]
git clone [repo / URL] [folder]
git config --global user.name "[your_name]"
2020-12-28
Important MySQL Commands

To login (from unix shell) use -h only if needed.

[mysql dir]/bin/mysql -h hostname -u username -p password

To login (from windows)

[mysql dir]/bin/mysql.exe -h hostname -u username -p password

Create a database.

mysql> create database [databasename];

List all databases on the server.

mysql> show databases;

Switch to a database.

mysql> use [db name];
2020-12-26
The Android Keystore

While full-disk and file-based encryption goes a long way to protecting the data stored on an Android device, for some especially sensitive data like passwords etc., this may not be enough.

The problem is that if an attacker is able to compromise the Linux kernel or gain root access via some other means, then since the kernel is able to read the unencrypted contents of any files stored on the device (once the user has entered their password), the attacker can gain access to any sensitive data. Also, even if an attacker is not able to gain root access, if they can nonetheless compromise your app, then they can gain access to your app’s data.

The solution is to directly encrypt the most sensitive data before storing it.

Getting this right though is hard, and we strongly recommend you speak to a security expert before attempting this.


Posted by chris on: 2020-12-26, Category: Flutter

Many linguists believe that the natural language a person speaks affects how they think. Does the same concept apply to computer languages? Programmers working in different kinds of programming languages often come up with radically different solutions to problems. As a more extreme example, computer scientists eliminated the goto statement to encourage more structured programs (not quite the same as totalitarian leaders in the novel 1984 expunging heretical words from natural language to eliminate thoughtcrimes, but you get the idea).

What does this have to do with Flutter and Dart? Quite a bit actually. The early Flutter team evaluated more than a dozen languages, and picked Dart because it matched the way they were building user interfaces.

Dart is a big reason why developers love Flutter. As one tweet puts it:

Why Flutter Uses Dart?

Many linguists believe that the natural language a person speaks affects how they think. Does the same concept apply to computer languages? Programmers working in different kinds of programming languages often come up with radically different solutions to problems. As a more extreme example, computer scientists eliminated the goto statement to encourage more structured programs (not quite the same as totalitarian leaders in the novel 1984 expunging heretical words from natural language to eliminate thoughtcrimes, but you get the idea).

What does this have to do with Flutter and Dart? Quite a bit actually. The early Flutter team evaluated more than a dozen languages, and picked Dart because it matched the way they were building user interfaces.

Dart is a big reason why developers love Flutter. As one tweet puts it: