# Module: type/s2k

## type/s2k

#### new require("type/s2k")()

  Source:
    - type/s2k.js, line 33

Source:
  - type/s2k.js, line 18

### Members

#### algorithm :openpgp.hash

  ##### Type:

  - openpgp.hash
  Source:
    - type/s2k.js, line 35

#### salt :openpgp_byte_array

  Eight bytes of salt.

  ##### Type:

  - openpgp_byte_array
  Source:
    - type/s2k.js, line 42

#### type :module:type/s2k

  ##### Type:

  - module:type/s2k
  Source:
    - type/s2k.js, line 37

### Methods

#### produce_key(passphrase) → {String}

  Produces a key using the specified passphrase and the defined hashAlgorithm

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `passphrase` | String | Passphrase containing user input

  Source:
    - type/s2k.js, line 133

  ##### Returns:

  Produced key with a length corresponding to hashAlgorithm hash length
  Type
    String

#### read(input) → {Integer}

  Parsing function for a string-to-key specifier (RFC 4880 3.7).

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `input` | String | Payload of string-to-key specifier

  Source:
    - type/s2k.js, line 57

  ##### Returns:

  Actual length of the object
  Type
    Integer

#### write() → {String}

  writes an s2k hash based on the inputs.
  Source:
    - type/s2k.js, line 107

  ##### Returns:

  Produced key of hashAlgorithm hash length
  Type
    String