• Stars
    star
    13
  • Rank 1,462,960 (Top 30 %)
  • Language
    Erlang
  • License
    BSD 3-Clause "New...
  • Created over 14 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Erlang NIF wrapping Unix crypt(3)

crypt library for Erlang

Package Version Hex Docs

Wrapper around the system crypt(3) library for Erlang.

WARNING

The algorithms supported by crypt are dependent on the system crypt(3) library.

USAGE

crypt(Key, Salt) -> binary()
crypt_to_string(Key, Salt) -> string()

    Types   Key = iodata()
            Salt = iodata()
            Crypted = binary()

    Calls the system crypt(3) function with the provided arguments.

    If crypt(3) is not supported by the OS, the crypt module will
    fail to load.

    Depending on your system crypt(3) library, errors may or may not
    be returned. Some implementations return NULL. If this occurs,
    crypt/2 will throw a bad arg exception. Other implementations
    may choose to return a fixed string (if this is a concern,
    the caller will need to test for this condition).

    The NetBSD man page for crypt(3) summarizes the situation as:

        The behavior of crypt() on errors isn't well standardized.
        Some implementations simply can't fail (unless the process
        dies, in which case they obviously can't return), others
        return NULL or a fixed string.  Most implementations
        don't set errno, but some do.  Version 2 of the Single
        UNIX Specification (``SUSv2'') specifies only returning
        NULL and setting errno as a valid behavior, and defines
        only one possible error (ENOSYS, ``The functionality is
        not supported on this implementation.'') Unfortunately,
        most existing applications aren't prepared to handle NULL
        returns from crypt().  The description below corresponds
        to this implementation of crypt() only.  The behavior may
        change to match standards, other implementations or existing
        applications.

        crypt() may only fail (and return) when passed an invalid
        or unsupported setting, in which case it returns a pointer
        to a magic string that is shorter than 13 characters and is
        guaranteed to differ from setting.  This behavior is safe
        for older applications which assume that crypt() can't fail,
        when both setting new passwords and authenticating against
        existing password hashes.

EXAMPLES

1> crypt:crypt("test","aa").
<<"aaqPiZY5xR5l.">>
2> crypt:crypt("test","$1$aaaaaaaa").
<<"$1$aaaaaaaa$lWxWtPmiNjS/cwJnGm6fe0">>
3> crypt:crypt("test","$6$aaaaaaaa").
<<"$6$aaaaaaaa$HREHv6TuSmUS/7spCDO5Js3ssSZ6.iwVkUoVtatJUhJDKVmERrRKBTolrPMub2s5dX6IEjZg6d6wZzFRlidV41">>
4> crypt:crypt_to_string(<<"test">>,"aa").
"aaqPiZY5xR5l."

More Repositories

1

procket

Erlang interface to low level socket operations
C
284
star
2

epcap

Erlang packet capture interface using pcap
C
178
star
3

pkt

Erlang network protocol library
Erlang
149
star
4

gen_icmp

Erlang interface to ICMP sockets
Erlang
100
star
5

evum

["Linux VM", ["Erlang Process", ["Erlang VM"]]].
Erlang
86
star
6

tunctl

Erlang TUN/TAP interface
Erlang
76
star
7

sods

Socket over DNS tunnel
C
69
star
8

verx

Erlang implementation of the libvirtd remote protocol
Erlang
58
star
9

srly

Native Erlang Unix serial interface
Erlang
54
star
10

alcove

Control plane for system processes
C
47
star
11

prx

an Erlang library for interacting with Unix processes
Erlang
35
star
12

erlang-libvirt

Erlang binding to libvirt virtualization API
Erlang
35
star
13

libkeepalive

LD_PRELOAD library for enabling TCP keepalive socket options
C
32
star
14

emdns

Erlang multicast DNS and DNS-SD (DNS Service Discovery)
Erlang
32
star
15

ewpcap

Portable native Erlang raw socket interface using pcap
Erlang
32
star
16

gen_unix

Erlang Unix socket interface
Erlang
30
star
17

wierl

Erlang interface for manipulating 802.11 wireless devices
Erlang
24
star
18

xmppipe

stdio over XMPP
C
23
star
19

erlxc

Simple, safe erlang interface for managing Linux Containers
Erlang
22
star
20

stk500

Enough of the STK500 protocol in Erlang to control the Arduino boot loader
Erlang
21
star
21

libproxyproto

Proxy protocol v1 and v2 support via an LD_PRELOAD library
C
21
star
22

inert

An Erlang library for notification of events on file descriptors
Erlang
19
star
23

seds

Erlang socket over DNS tunnel server
Erlang
19
star
24

epcap_compile

Compile pcap-filter(7) expressions to BPF programs
Erlang
15
star
25

perc

Erlang interface for controlling Unix processes
Erlang
15
star
26

herp

Erlang user space bridge
Erlang
14
star
27

spoofed

Spoof the Erlang Distribution Protocol!
Erlang
14
star
28

execve

Go package for fexecve(3) and execveat(2)
Go
13
star
29

erpcgen

RPC/XDR protocol compiler (from jungerl)
Erlang
13
star
30

reuseport

SO_REUSEPORT socket load distribution using LD_PRELOAD
C
13
star
31

tuntap

Erlang "Universal TUN/TAP device" driver from Jungerl
C
12
star
32

islet

Simple, safe isolation using Erlang
Erlang
12
star
33

sut

Six (IPv6 in IPv4) Userlspace Tunnel
Erlang
11
star
34

erlang-notify-osd

Erlang NIF interface for sending desktop notifications
Erlang
11
star
35

farp

Poison the ARPs, courtesy of Erlang
Erlang
10
star
36

perv

Media captured from the ether for your viewing pleasure
Erlang
9
star
37

cerck

Password quality checks for Erlang
Erlang
9
star
38

runcron

simple, safe, container-friendly cron alternative
C
8
star
39

spood

The spoofing DNS proxy with a vaguely obscene name
Erlang
8
star
40

totp.c

simple, standalone TOTP without dependencies
C
7
star
41

drench

Makes things go ... down
C
7
star
42

sredird

RFC 2217 network serial port redirector
C
6
star
43

everl

Async socket notifications for Erlang using libev
C
6
star
44

ampule

An elixir library for linux containers
Elixir
6
star
45

libenospace

Process-based disk usage limits
C
6
star
46

runlet

Event stream query and flow control
Elixir
5
star
47

rst

Think of it as peer to peer QoS
C
5
star
48

trep

Selectively stream stdin to stdout/stderr based on regular expressions
C
4
star
49

wat

A simple example of an Erlang NIF for creating mutable variables
C
4
star
50

librlimit

rlimit sandbox for any process
C
4
star
51

pseudocron

sleep(1) using a cron expression
C
3
star
52

libsockfilter

Connection filtering for dynamically linked applications
C
3
star
53

stdio

Reliably reap, restrict and isolate system tasks: Stdio is a control plane for processes
Elixir
3
star
54

cm17a

Erlang X10 Firecracker (CM17A) Interface
Erlang
3
star
55

wwallo

Tag cloud for your geo location
JavaScript
2
star
56

libnoexec

Prevent dynamically linked executables from calling exec(3)
C
2
star
57

embedexe

Run an executable embedded in a Go binary
Go
2
star
58

runlet_sh

Generate runlets from containerized Unix processes
Elixir
2
star
59

collectd-prv

stdout to collectd notification
C
1
star
60

tscat

Timestamp stdin to stdout/stderr
C
1
star
61

runhash-go

runhash: command line interface for distributed node selection
Go
1
star
62

noprivexec

noprivexec: disable setuid privileges
C
1
star
63

pdeathsigexec

signal process when parent exits
C
1
star
64

tcpexec-rs

tcpexec: a minimal, UCSPI inetd
Rust
1
star
65

unixexec

attach stdin/stdout of a command to a Unix socket
C
1
star
66

pipewatch

pipewatch: supervise pipelines of processes
C
1
star
67

fchmodexec

fchmod(2) inherited file descriptors before exec(3)'ing a command
C
1
star
68

prv

pressure relief valve for Unix process pipelines
C
1
star
69

closefrom

close(2) a range of file descriptors before exec(2)
C
1
star
70

xmppipe-go

stdio over XMPP
Go
1
star
71

runlimit

restart intensity limits for supervised Unix processes
C
1
star
72

tcpexec

tcpexec: a minimal, UCSPI inetd
C
1
star
73

logsurfer-

Rules based log file monitoring and alerting tool
C
1
star
74

imappipe

poll IMAP mailbox to stdout
Go
1
star
75

hexlog

Hexdump stdin and/or stdout to stderr
C
1
star
76

runlock

rate limit command invocation based on the last successful run time
C
1
star
77

eventbot

A bot for generating and interacting with event streams using XMPP
Elixir
1
star
78

goreap

User init to supervise and terminate subprocesses
Go
1
star
79

dnsup

Publish an IP address using the Cloudflare API
Go
1
star
80

genlb-ptrace

connect(2) load balancer for Unix processes
C
1
star
81

runlet_net

Miscellaneous network related commands for runlets
Erlang
1
star