Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Build Status

sf-pwgen is a command line tool which generates passwords using the SecurityFoundation framework in macOS. It runs on Mountain Lion and later.

sf-pwgen 1.5: macOS password generator
Anders Bergh <>

usage: ./sf-pwgen [options]

Available options are:
  -a, --algorithm    Available algorithms: memorable, random, letters, alphanumeric, numbers.
                     The default is `memorable'.
  -c, --count        The number of passwords to generate (default: 5).
  -l, --length       Desired length of the generated passwords (default: 12).
  -L, --language     Generate passwords in a specified language.
                     Languages: en, de, es, fr, it, nl, pt, jp.
                     Note that this feature is broken and will produce garbage, bug: rdar://14889281
  -v, --version      Print the version number and exit.
  -h, --help         Print this message.


This project also includes SFPasswordAssistant.h, which is a reverse-engineered header for Apple's password assistant API (used in Keychain, etc). It should work on Snow Leopard and above.

To use it simply include SFPasswordAssistant.h in your project and link to SecurityFoundation.framework.