I would like to print randomly generated passwords, so that look-alike characters like zero and the letter "o" or one and the letter "l" are clearly distinguishable. I would also like to find a way to visualize spaces, I.e. I'm looking for a font that does that or an alternative to underscores (since the passwords may contain underscores)

So far the best I found is "Bitstream vera sans mono" in openoffice based on this: http://forums.overclockers.co.uk/showthread.PHP?p=16215032 (Strangely enough it's not listed in the font list, but if I type it in, it works. :/) "Lucida Console" doesn't seem to exist in openoffice/libreoffice.

I could of course regenerate the passwords without look-alike characters and spaces, but I would like to know if someone knows of a nice solution to this problem, ideally just a font with slashed zeroes and visible space characters.

link|improve this question
1  
You might simplify the problem a bit by eliminating a few troublesome characters such as space. Given the large character set of upper/lower letters, number and punctuation characters, I would eliminate spaces for instance without significantly reducing the combinatoric possibilities – uSlackr May 27 '11 at 12:44
How about the OCR-A font? – Linker3000 May 27 '11 at 12:48
Your OS might have DejaVu installed instead of Bitstream Vera. DejaVu is a fork of Bistream Vera that adds a lot of variants and extra support for other languages. – afrazier May 27 '11 at 19:25
feedback

4 Answers

up vote 4 down vote accepted

By far my favorite font is Inconsolata, "a monospace font, designed for code listings and the like, in print."

Inconsolata preview

But it doesn't visualize spaces. To achieve that you could, in reverse order of effort:

1a) send your passwords through sed and replace with a string like <SPACE>

$ echo 'Il10O O01lI' | sed 's/ /<SPACE>/g'
Il10O<SPACE>O01lI

1b) ... or a Unicode character you're certain will never ever appear in your passwords (You'll need an sed that can handle Unicode, like GNU sed, for this)

$ echo 'Il10O O01lI' | sed 's/ /˘/g'
Il10O˘O01lI

2) edit the font with FontForge to replace the Space glyph with one that suits your taste and requirements. (Inconsolata is open and free; its FontForge source can be downloaded on its homepage.)

link|improve this answer
Inconsolata ftw – Sathya May 27 '11 at 15:13
Thanks, that looks interesting. But how do I install the font? (under GNU/Linux) – KIAaze May 27 '11 at 17:17
Thanks a lot. Yes, double-clicking works, but it's also good to learn the CLI way. :) I was on Ubuntu 10.04 last time and couldn't get the font to work in Openoffice (but it worked in Kword). So I found another way via latex. Now on Ubuntu 11.04, it worked without any problems in openoffice and I even managed to modify the space character to U+2423 (␣) with fontforge. Note: There's even a ttf-inconsolata package in the repositories. – KIAaze May 31 '11 at 1:41
This font is available from Google Web Fonts: google.com/webfonts#QuickUsePlace:quickUse/Family:Inconsolata – sgriffinusa Sep 5 '11 at 15:10
feedback

As @uSlackr said, eliminating the troublesome characters helps a lot, if you are generating these yourself.

That said, you'll want to look at fonts optimized for programmers, because they run into these kinds of problems all the time. Everyone's got an opinion, so Google for "programming fonts" and you'll finds lots of pages with samples to view, like this one. I'm very partial to Consolas myself:

Consolas Sample

Now, one thing you can do to help out with the visible whitespace is use Notepad2 as a text editor. (I use the Notepad2-Mod variant myself.) It has an option for visible whitespace, so tabs are denoted with an arrow and spaces with a small dot in the middle of the character space. This isn't just for display though, these will also print out. Below is a snapshot of a PDF created by printing from Notepad 2 with visible whitespace and indentation guides on:

Consolas w/ spaces

All other Scintilla-based editors probably behave in the same way.

link|improve this answer
feedback

You could do it like banks print their PIN numbers - both normally and phonetically.

So the password 'h30yg28fi1' would be also written:

AICH THREE ZERO WHY GEE TWO EIGHT EFF EYE ONE

or something similar.

That would differenciate "oh", "OH" and "ZERO", "eye", "EYE", "ell", "ELL" and "ONE" quite well.

link|improve this answer
feedback

Sorry for the late feedback. I used this solution in the end (bitstream vera font in latex with verbatim*):

\documentclass{article}

\usepackage{bera}

\begin{document}

% text using bera font (Bitstream Vera), which has dotted zeroes
% the * after verbatim adds visible spaces
\begin{verbatim*}'1 l oO0}4 _i6D-WtF#q\end{verbatim*}

% visible space
hello\textvisiblespace world

% slashed zero
\o

\end{document}

I left a few of the other things I tried as well.

To create a pdf from it:

pdflatex password_printing_4.tex

If you get any errors, try simply installing texmaker. It depends on most necessary latex packages:

sudo apt-get install texmaker

I also tried the inconsolata font in latex, but it doesn't seem to be the same:

\documentclass{article}

\usepackage{inconsolata}
%\usepackage{bera}

% requires texlive-xetex package:
\usepackage[xetex]{graphicx}
%\usepackage{fontspec,xunicode}
%\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
%\setmainfont[Scale=.95]{Inconsolata}

\begin{document}

% text using bera font (Bitstream Vera), which has dotted zeroes
% the * after verbatim adds visible spaces
\begin{verbatim*}`!=}k o6~-cRR1loO0\end{verbatim*}

%\renewcommand{\bera}{\inconsolata}
\texttt{This is Inconsolata. zero: 0}

%\renewcommand{\inconsolata}{\bera}
\texttt{This is Bera. zero: 0}

% visible space
hello\textvisiblespace world

% slashed zero
\o

\end{document}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.