Password Strength

A password’s “strength” comes from three elements of the password:

  1. The length of a password.  We measure the length as the number of characters password. “password” is 8 characters long. A longer password is more difficult to discover through brute force methods. This is because there is a larger set of elements to test.
  2. The range of characters allowed in the password.   A large set of possible characters makes brute force discovery of passwords more difficult. This is because there is a larger set of characters to test in for each possible password element.
  3. The cracking speed of a brute force generator.  Attackers can use brute forcing tools that will try to grind through all possible passwords. This relates to the speed of the cracker, such as 1,000,000 tries per second.

There is a simple formula to discover the number of possible password passwords on a system. You only need to know the set of possible characters & the length of the password.  

Let us assume the password length is 8 characters. Let us also assume that there are no restrictions on reusing characters within the password.  

We will calculate the number of possible Permutations With Repetition.

Let’s refer to the password as an “array.”  An array is a data structure that is a collection of elements.  If a password is 8 characters long, we’re saying that the password is an array that can have 8 elements in it.  Each element gets it’s own character.  We can visualize a password array using the password “PASSWORD”

PASSWORD
An example all uppercase 8 character password array

P is the first element. A is the second element. S is the third element and so on.

Let us assume only upper case letters are allowed in the password. The possible range of characters for the first element is: [A,B,C, … X,Y,Z].  So this gives us a 26 possible values that could be included in the password.

Unfortunately, passwords often include lower case letters. We need to add the range of lowercase characters in set.  If the password is only Upper and Lower case values, that means we have 26+26= 52 possible values.  

password
PASSWORD
An all lowercase and an all uppercase 8 character password array

Passwords often have include Numbers.  Since each element only has one character, this means that the set of possible values are between 0 and 9.  The total number of possible values is 10, so we must increase our potential set of possible values to 26+26+10= 62 possible values.  

When looking at our 8 character password, we’ll just include the ordered list of numbers from 0 to 7 in our example.  Note that it could be any order of numbers included.

password
PASSWORD
01234567
An all lowercase and an all uppercase 8 character password array, followed by an example password consisting of only numbers.

Finally, passwords often include special characters & punctuation.  There are 33 characters & special punctuation marks on the standard US keyboard.  

password
PASSWORD
01234567
!@#$%^&*
An all lowercase and an all uppercase 8 character password array, followed by an example password consisting of only numbers and an example password of only special characters.

In our visualization, we included the 4 arbitrary password examples. PASSWORD and some 8 character passwords consisting of only numbers & letters.  In all likelihood, none of these examples are going to be correct.  It’s likely to be an ugly combination of something like “72%aoPs4”.

Our total possible values has become 26+26+10+33=95 possible values.  This means in our 8 character password, each element could have one of 95 possible values.

We calculate the potential set of values as n^k, where n is the set of possible values and k is the length of the the password (also referred to as the number of elements) .  This means there are 95^8 possible values, which translates to 6,634,204,312,890,625 possible passwords.  So about 6.6 quadrillion passwords.  This is a big number.  

Let’s assume you could create one password per second. It would take you about 210 million years to exhaust the potential set of passwords. Luckily, computers can help us test far more than one password per second.  But it still would take time to get through the entire set of passwords.  Cracking a password by trying every possible combination will take a lot of time. Is there a better strategy?

Some Cool Things

LEARN HTTP:

This is the best crash course I’ve seen for learning http at a deep and practical linux practioner level. I love that they are demoing how to pipe linux commands together to construct these requests and demonstrate how to make different classes of requests. If you are passionate about networking, this is an amazing read:

https://fasterthanli.me/articles/the-http-crash-course-nobody-asked-for

Accelerate Ansible Playbook Development

This is a Proof of Concept demo that is showing an application of a concept akin to Github’s copilot with Ansible. I spend a lot of time building ansible playbooks to do a thing. I’ve been thinking about how to tag & document useful playbooks. This demo is something I’ve been striving to create- but IBM has demo’d it faster:

https://research.ibm.com/blog/ai-for-code-project-wisdom-red-hat

Ansible: Saving Time by Locally Caching material

The BuilderHotspot can be used to save time building Single Board Computing firmware images where firmware components are installed using apt-get.

Downloading & compiling drivers can be painfully slow. I recently built a recipe for running a phony wifi network that spoofs common wifi SSIDs like “NETGEAR”. The solution relies on the AWUS036AH wifi adapter. These drivers aren’t available via apt- so I I need to download, configure, compile & install drivers. These activities add about 30 minutes to a firmware build- it would be advantageous to find some ways to speed this up.

We can reduce some time by:

  • Saving the driver files locally on the builder hotspot
  • pre-compiling them for target machines
  • syncing them to the target
  • then running make install on the target system.

I don’t want to package the drivers in the main recipe I publish- the drivers may be inappropriate for the target system- so I need a solution that will work for people generally.

I solved this problem by using some ansible conditionals.

I precompiled the rtl8812au drivers and stuck them in the Pi’ account’s home directory on the BuilderHotspot.

The logic of this playbook is:

If I have a rtl8812au in the home directory (discovered by stat’ing the location), register a variable called rtl8812au_config.

If the variable is defined, then I can use the synchronize step.

If the variable is not defined (because the directory was not identified), then we’ll go ahead and do a git clone- and in later steps, compile and install the drivers.

   - name: Check for /home/pi/rtl8812au
     delegate_to: localhost
     stat:
       path: /home/pi/rtl8812au
     register: rtl8812au_config 
     tags:          
     - dual_nic
     - catcher
     - awus03ach_wifi

   - name: Synchronization of files for rtl8812 wifi 
     synchronize: 
       src: "/home/pi/rtl8812au"
       dest: /tmp/
     when: rtl8812au_config is defined
     tags:          
     - dual_nic
     - catcher
     - awus03ach_wifi

   - name: Clone of rtl8812au drivers
     ansible.builtin.git:
       repo: https://github.com/aircrack-ng/rtl812au.git/
       dest: /tmp
       single_branch: yes
       version: master
     when: rtl8812au_config is undefined
     tags:          
     - dual_nic
     - catcher
     - awus03ach_wifi 

Configure dhcpcd to ignore wlan0


If you futz with multiple nics on a raspberry pi, at some point you will have to deal with disabling dhcp on a specific NIC. Here is some quick guidance on what to do:

Configure dhcpcd to ignore wlan0

dhcpcd is the linux dhcp client. dnsmasq is commonly used as a dhcp server. If you are doing something with both on the same client, you might have weird conditions where you are trying to set a static ip on the interface that is vending dhcp addresses. You’ll want to disable that interface from listening to the dhcp server.

Check /etc/network/interfaces; this should be empty except for an include from /etc/network/interfaces.d (which is in turn empty).

Edit /etc/dhcpcd.conf:

denyinterfaces wlan0

sudo systemctl restart dhcpcd.

BuilderHotspot //todos

Publish a repository of example recipes that includes:

  • Marathon Wifi trap
  • The Easiest Raspberry Pi Web Server
  • Photo Sharing Solution
  • Pcap on demand
  • Recipe with universally valuable defaults for catching gotchas
  • Unit Tests for validating a recipe

Update Default Recipe to address unnecessarily large journal logs (https://askubuntu.com/questions/1238214/big-var-log-journal)

edit /etc/systemd/journald.conf to Activate the SystemMaxUse= option there, e.g. as SystemMaxUse=100M to only use 100 MB.

Advice on writing clearly

I’m frequently receiving requests for writing advice due to the clarity of my writing. I found an article on hackernews that resonates with me greatly. If persuasive writing is a skill you hope to develop, you should read this: http://www.covingtoninnovations.com/mc/WriteThinkLearn.pdf

In particular, the following ideas reflect a motivation I always try to capture in my writing:

“I’m not giving this presentation (or writing this paper) because I’m important. I’m doing it because you’re important.”

“I’m not going to demand that you put up with my quirks (bad spelling, bad organization, sloppiness [ME: Lolcat memes]). I’m going to package the information so that it enters your heads as easily as possible.”

Remembering that you are writing to help others seems to have a consistent impact-multiplier effect. I encourage you to be humble and consider how to invoke this motivation in your writing style.