/external/openssh/openbsd-compat/ |
D | xcrypt.c | 78 static char salt[32]; in pick_salt() local 80 if (salt[0] != '\0') in pick_salt() 81 return salt; in pick_salt() 82 strlcpy(salt, "xx", sizeof(salt)); in pick_salt() 88 strlcpy(salt, passwd, MIN(typelen, sizeof(salt))); in pick_salt() 95 return salt; in pick_salt() 99 xcrypt(const char *password, const char *salt) in xcrypt() argument 107 if (salt == NULL) in xcrypt() 108 salt = pick_salt(); in xcrypt() 111 if (is_md5_salt(salt)) in xcrypt() [all …]
|
D | port-uw.c | 57 char *salt; in sys_auth_passwd() local 68 salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx"; in sys_auth_passwd() 76 result = ((strcmp(bigcrypt(password, salt), pw_password) == 0) in sys_auth_passwd() 77 || (strcmp(osr5bigcrypt(password, salt), pw_password) == 0)); in sys_auth_passwd() 81 result = (strcmp(xcrypt(password, salt), pw_password) == 0); in sys_auth_passwd()
|
/external/e2fsprogs/misc/ |
D | e4crypt.c | 180 struct salt { struct 181 unsigned char *salt; argument 187 struct salt *salt_list; argument 192 static struct salt *find_by_salt(unsigned char *salt, size_t salt_len) in find_by_salt() argument 195 struct salt *p; in find_by_salt() 199 !memcmp(p->salt, salt, salt_len)) in find_by_salt() 204 static void add_salt(unsigned char *salt, size_t salt_len) in add_salt() argument 206 if (find_by_salt(salt, salt_len)) in add_salt() 210 salt_list = realloc(salt_list, max_salt * sizeof(struct salt)); in add_salt() 216 salt_list[num_salt].salt = salt; in add_salt() [all …]
|
/external/f2fs-tools/tools/ |
D | f2fscrypt.c | 222 struct salt { struct 223 unsigned char *salt; member 229 struct salt *salt_list; argument 234 static struct salt *find_by_salt(unsigned char *salt, size_t salt_len) in find_by_salt() argument 237 struct salt *p; in find_by_salt() 241 !memcmp(p->salt, salt, salt_len)) in find_by_salt() 246 static void add_salt(unsigned char *salt, size_t salt_len) in add_salt() argument 248 if (find_by_salt(salt, salt_len)) in add_salt() 252 salt_list = realloc(salt_list, max_salt * sizeof(struct salt)); in add_salt() 258 salt_list[num_salt].salt = salt; in add_salt() [all …]
|
/external/toybox/toys/other/ |
D | mkpasswd.c | 30 char *salt; 35 char salt[MAX_SALT_LEN] = {0,}; local 40 if (TT.salt) error_exit("duplicate salt"); 41 TT.salt = toys.optargs[1]; 44 if (-1 == (i = get_salt(salt, TT.method))) error_exit("bad -m"); 45 if (TT.salt) { 46 char *s = TT.salt; 52 snprintf(salt+i, sizeof(salt)-i, "%s", TT.salt); 77 xprintf("%s\n",crypt(*toys.optargs ? *toys.optargs : toybuf, salt));
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/ |
D | PKCS12KeyWithParameters.java | 14 private final byte[] salt; field in PKCS12KeyWithParameters 24 public PKCS12KeyWithParameters(char[] password, byte[] salt, int iterationCount) in PKCS12KeyWithParameters() argument 28 this.salt = Arrays.clone(salt); in PKCS12KeyWithParameters() 42 …hParameters(char[] password, boolean useWrongZeroLengthConversion, byte[] salt, int iterationCount) in PKCS12KeyWithParameters() argument 46 this.salt = Arrays.clone(salt); in PKCS12KeyWithParameters() 57 return salt; in getSalt()
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/asn1/pkcs/ |
D | PBEParameter.java | 18 ASN1OctetString salt; field in PBEParameter 21 byte[] salt, in PBEParameter() argument 24 if (salt.length != 8) in PBEParameter() 28 this.salt = new DEROctetString(salt); in PBEParameter() 35 salt = (ASN1OctetString)seq.getObjectAt(0); in PBEParameter() 61 return salt.getOctets(); in getSalt() 68 v.add(salt); in toASN1Primitive()
|
D | MacData.java | 22 byte[] salt; field in MacData 45 this.salt = Arrays.clone(((ASN1OctetString)seq.getObjectAt(1)).getOctets()); in MacData() 59 byte[] salt, in MacData() argument 63 this.salt = Arrays.clone(salt); in MacData() 74 return Arrays.clone(salt); in getSalt() 98 v.add(new DEROctetString(salt)); in toASN1Primitive()
|
D | PBKDF2Params.java | 69 byte[] salt, in PBKDF2Params() argument 72 this(salt, iterationCount, 0); in PBKDF2Params() 83 byte[] salt, in PBKDF2Params() argument 87 this(salt, iterationCount, keyLength, null); in PBKDF2Params() 99 byte[] salt, in PBKDF2Params() argument 104 this.octStr = new DEROctetString(Arrays.clone(salt)); in PBKDF2Params() 127 byte[] salt, in PBKDF2Params() argument 131 this(salt, iterationCount, 0, prf); in PBKDF2Params()
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/keystore/bc/ |
D | BcKeyStoreSpi.java | 142 byte[] salt = new byte[KEY_SALT_SIZE]; in StoreEntry() 145 random.nextBytes(salt); in StoreEntry() 153 dOut.writeInt(salt.length); in StoreEntry() 154 dOut.write(salt); in StoreEntry() 157 … cipher = makePBECipher(KEY_CIPHER, Cipher.ENCRYPT_MODE, password, salt, iterationCount); in StoreEntry() 229 byte[] salt = new byte[dIn.readInt()]; in getObject() 231 dIn.readFully(salt); in getObject() 235 …ipher cipher = makePBECipher(KEY_CIPHER, Cipher.DECRYPT_MODE, password, salt, iterationCount); in getObject() 248 salt = new byte[dIn.readInt()]; in getObject() 250 dIn.readFully(salt); in getObject() [all …]
|
/external/libbrillo/brillo/ |
D | cryptohome.cc | 31 static std::string* salt = nullptr; variable 34 if (salt && !salt->empty()) in EnsureSystemSaltIsLoaded() 55 if (!salt) in EnsureSystemSaltIsLoaded() 56 salt = new std::string(); in EnsureSystemSaltIsLoaded() 57 salt->assign(buf.data(), file_size); in EnsureSystemSaltIsLoaded() 71 SHA1_Update(&ctx, salt->data(), salt->size()); in SanitizeUserName() 133 return salt; in GetSystemSalt() 137 salt = value; in SetSystemSalt()
|
/external/syslinux/utils/ |
D | md5pass | 27 ($pass, $salt) = @ARGV; 29 unless (defined($salt)) { 30 $salt = MIME::Base64::encode(random_bytes(6), ''); 31 $salt =~ tr/\+/./; # . not + 34 print unix_md5_crypt($pass, $salt), "\n";
|
D | sha1pass | 27 ($pass, $salt) = @ARGV; 29 unless (defined($salt)) { 30 $salt = MIME::Base64::encode(random_bytes(6), ''); 32 $pass = Digest::SHA1::sha1_base64($salt, $pass); 34 print '$4$', $salt, '$', $pass, "\$\n";
|
/external/boringssl/src/crypto/pkcs8/ |
D | pkcs8.c | 99 int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, in pkcs12_key_gen() argument 160 I[i] = salt[i % salt_len]; in pkcs12_key_gen() 232 const uint8_t *salt, size_t salt_len, in pkcs12_pbe_cipher_init() argument 239 if (!pkcs12_key_gen(pass, pass_len, salt, salt_len, PKCS12_KEY_ID, iterations, in pkcs12_pbe_cipher_init() 241 !pkcs12_key_gen(pass, pass_len, salt, salt_len, PKCS12_IV_ID, iterations, in pkcs12_pbe_cipher_init() 256 CBS pbe_param, salt; in pkcs12_pbe_decrypt_init() local 259 !CBS_get_asn1(&pbe_param, &salt, CBS_ASN1_OCTETSTRING) || in pkcs12_pbe_decrypt_init() 273 pass_len, CBS_data(&salt), CBS_len(&salt), in pkcs12_pbe_decrypt_init() 328 size_t pass_len, const uint8_t *salt, in pkcs12_pbe_encrypt_init() argument 343 !CBB_add_bytes(&salt_cbb, salt, salt_len) || in pkcs12_pbe_encrypt_init() [all …]
|
D | p5_pbev2.c | 144 size_t pass_len, const uint8_t *salt, in pkcs5_pbe2_cipher_init() argument 153 int ret = PKCS5_PBKDF2_HMAC_SHA1(pass, pass_len, salt, salt_len, iterations, in pkcs5_pbe2_cipher_init() 163 const uint8_t *salt, size_t salt_len) { in PKCS5_pbe2_encrypt_init() argument 188 !CBB_add_bytes(&salt_cbb, salt, salt_len) || in PKCS5_pbe2_encrypt_init() 204 return pkcs5_pbe2_cipher_init(ctx, cipher, iterations, pass, pass_len, salt, in PKCS5_pbe2_encrypt_init() 237 CBS pbkdf2_params, salt; in PKCS5_pbe2_decrypt_init() local 241 !CBS_get_asn1(&pbkdf2_params, &salt, CBS_ASN1_OCTETSTRING) || in PKCS5_pbe2_decrypt_init() 305 pass_len, CBS_data(&salt), CBS_len(&salt), in PKCS5_pbe2_decrypt_init()
|
/external/syslinux/com32/libutil/ |
D | sha256crypt.c | 291 static char *sha256_crypt_r(const char *key, const char *salt, char *buffer, in sha256_crypt_r() argument 314 if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0) in sha256_crypt_r() 316 salt += sizeof(sha256_salt_prefix) - 1; in sha256_crypt_r() 318 if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1) in sha256_crypt_r() 320 const char *num = salt + sizeof(sha256_rounds_prefix) - 1; in sha256_crypt_r() 324 salt = endp + 1; in sha256_crypt_r() 330 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in sha256_crypt_r() 340 if ((salt - (char *)0) % __alignof__(uint32_t) != 0) { in sha256_crypt_r() 342 salt = copied_salt = memcpy(tmp + __alignof__(uint32_t) in sha256_crypt_r() 344 salt, salt_len); in sha256_crypt_r() [all …]
|
D | sha512crypt.c | 326 static char *sha512_crypt_r(const char *key, const char *salt, char *buffer, in sha512_crypt_r() argument 349 if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0) in sha512_crypt_r() 351 salt += sizeof(sha512_salt_prefix) - 1; in sha512_crypt_r() 353 if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1) in sha512_crypt_r() 355 const char *num = salt + sizeof(sha512_rounds_prefix) - 1; in sha512_crypt_r() 359 salt = endp + 1; in sha512_crypt_r() 365 salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); in sha512_crypt_r() 375 if ((salt - (char *)0) % __alignof__(uint64_t) != 0) { in sha512_crypt_r() 377 salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) in sha512_crypt_r() 379 salt, salt_len); in sha512_crypt_r() [all …]
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/ |
D | PBEParametersGenerator.java | 11 protected byte[] salt; field in PBEParametersGenerator 31 byte[] salt, in init() argument 35 this.salt = salt; in init() 56 return salt; in getSalt()
|
/external/python/cpython2/Doc/library/ |
D | crypt.rst | 31 .. function:: crypt(word, salt) 34 interface. *salt* is usually a random two-character string which will be used 35 to perturb the DES algorithm in one of 4096 ways. The characters in *salt* must 37 will be composed of characters from the same alphabet as the salt (the first two 38 characters represent the salt itself). 43 different sizes in the *salt*, it is recommended to use the full crypted 44 password as salt when checking for a password.
|
/external/boringssl/src/ssl/test/runner/ |
D | hkdf.go | 23 func hkdfExtract(hash func() hash.Hash, salt, ikm []byte) []byte { argument 24 if salt == nil { 25 salt = make([]byte, hash().Size()) 27 hmac := hmac.New(hash, salt)
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/generators/ |
D | OpenSSLPBEParametersGenerator.java | 43 byte[] salt) in init() argument 45 super.init(password, salt, 1); in init() 61 digest.update(salt, 0, salt.length); in generateDerivedKey()
|
/external/python/cpython2/Modules/ |
D | cryptmodule.c | 17 char *word, *salt; in crypt_crypt() local 22 if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) { in crypt_crypt() 27 return Py_BuildValue("s", crypt(word, salt)); in crypt_crypt()
|
/external/tpm2/ |
D | StartAuthSession.c | 38 TPM2B_DATA salt; in TPM2_StartAuthSession() local 71 &in->encryptedSalt, &salt); in TPM2_StartAuthSession() 81 salt.t.size = 0; in TPM2_StartAuthSession() 106 in->bind, &salt, &out->sessionHandle); in TPM2_StartAuthSession()
|
/external/wpa_supplicant_8/src/tls/ |
D | pkcs5.c | 26 u8 salt[64]; member 179 hdr.length > sizeof(params->salt)) { in pkcs5_get_params_pbes2() 186 os_memcpy(params->salt, hdr.payload, hdr.length); in pkcs5_get_params_pbes2() 188 wpa_hexdump(MSG_DEBUG, "PKCS #5: salt", params->salt, params->salt_len); in pkcs5_get_params_pbes2() 340 hdr.length > sizeof(params->salt)) { in pkcs5_get_params() 347 os_memcpy(params->salt, hdr.payload, hdr.length); in pkcs5_get_params() 350 params->salt, params->salt_len); in pkcs5_get_params() 395 params->salt, params->salt_len); in pkcs5_crypto_init_pbes2() 398 if (pbkdf2_sha1(passwd, params->salt, params->salt_len, in pkcs5_crypto_init_pbes2() 422 static int pkcs12_key_gen(const u8 *pw, size_t pw_len, const u8 *salt, in pkcs12_key_gen() argument [all …]
|
/external/boringssl/src/crypto/evp/ |
D | pbkdf.c | 66 const uint8_t *salt, size_t salt_len, unsigned iterations, in PKCS5_PBKDF2_HMAC() argument 94 !HMAC_Update(&hctx, salt, salt_len) || in PKCS5_PBKDF2_HMAC() 141 const uint8_t *salt, size_t salt_len, in PKCS5_PBKDF2_HMAC_SHA1() argument 144 return PKCS5_PBKDF2_HMAC(password, password_len, salt, salt_len, iterations, in PKCS5_PBKDF2_HMAC_SHA1()
|