You are not logged in.

#1 2014-02-14 09:13:56

RobinH
Member
From: The Netherlands
Registered: 2014-02-12
Posts: 1

Unencrypt drive on boot, show stars when typing password (dm-crypt)

In my current setup I use dm-crypt with LUKS on my root drive, requiring me to enter the password on boot. Because of the length and complexity of my password, I'd like to have some sort of indication that I'm not making a tiny mistake while typing. In other words, I'd like the password prompt to show a star (or any kind of character, really) instead of emptiness for each character I type.

I'm well aware of the security reasons for not showing these stars, but shoulder surfing is of minimal concern to me. Mistyping my password, on the other hand, is. Is there any way I can enable such a visual indication somewhere? I've searched the web, but was unable to find anything specifically related to dm-crypt at boot.

Offline

#2 2014-02-14 09:43:25

frostschutz
Member
Registered: 2013-11-15
Posts: 1,511

Re: Unencrypt drive on boot, show stars when typing password (dm-crypt)

If I remember correctly, Ubuntu does it in its "graphical" bootup prompt... not stars but "circles"?

I found one here: http://stackoverflow.com/questions/1923 … -with-read

Adapted it for busybox:

#!/bin/busybox sh

password=""
prompt="Enter Password:"
while IFS= read -p "$prompt" -r -s -n 1 char
do
    if [ "$char" == $'\0' ]
    then
        break
    fi
    prompt='*'
    password="$password$char"
done

echo -n "$password" | cryptsetup luksOpen ...

Although this example does not give you any retries...

Last edited by frostschutz (2014-02-14 09:44:18)

Offline

#3 2014-02-14 11:00:53

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: Unencrypt drive on boot, show stars when typing password (dm-crypt)

The stars actually show when unlocking the drive with systemd. I haven't documented this anywhere yet, but in the future, a systemd-based initramfs should be the default.

Offline

Board footer

Powered by FluxBB