Home
last modified time | relevance | path

Searched refs:salt (Results 1 – 25 of 79) sorted by relevance

1234

/external/apache-harmony/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/
DPBEKeySpecTest.java67 byte[] salt = new byte[] { 1, 2, 3, 4, 5 }; in testPBEKeySpec2()
72 PBEKeySpec pbeks = new PBEKeySpec(null, salt, in testPBEKeySpec2()
99 new PBEKeySpec(password, salt, -1, keyLength); in testPBEKeySpec2()
106 new PBEKeySpec(password, salt, iterationCount, -1); in testPBEKeySpec2()
113 new PBEKeySpec(password, salt, 0, keyLength); in testPBEKeySpec2()
120 new PBEKeySpec(password, salt, iterationCount, 0); in testPBEKeySpec2()
126 PBEKeySpec pbeks = new PBEKeySpec(password, salt, in testPBEKeySpec2()
132 salt[0]++; in testPBEKeySpec2()
135 salt[0] == pbeks.getSalt()[0]); in testPBEKeySpec2()
146 byte[] salt = new byte[] { 1, 2, 3, 4, 5 }; in testPBEKeySpec3()
[all …]
DPBEParameterSpecTest.java43 byte[] salt = { 1, 2, 3, 4, 5 }; in testPBEParameterSpec()
53 PBEParameterSpec pbeps = new PBEParameterSpec(salt, iterationCount); in testPBEParameterSpec()
54 salt[0]++; in testPBEParameterSpec()
57 salt[0] == pbeps.getSalt()[0]); in testPBEParameterSpec()
66 byte[] salt = new byte[] { 1, 2, 3, 4, 5 }; in testGetSalt()
68 PBEParameterSpec pbeps = new PBEParameterSpec(salt, iterationCount); in testGetSalt()
70 if (!Arrays.equals(salt, result)) { in testGetSalt()
85 byte[] salt = new byte[] { 1, 2, 3, 4, 5 }; in testGetIterationCount()
87 PBEParameterSpec pbeps = new PBEParameterSpec(salt, iterationCount); in testGetIterationCount()
/external/toybox/toys/other/
Dmkpasswd.c29 char *salt;
34 char salt[MAX_SALT_LEN] = {0,}; local
39 if (TT.salt) error_exit("duplicate salt");
40 TT.salt = toys.optargs[1];
43 if (-1 == (i = get_salt(salt, TT.method))) error_exit("bad -m");
44 if (TT.salt) {
45 char *s = TT.salt;
51 snprintf(salt+i, sizeof(salt)-i, "%s", TT.salt);
76 xprintf("%s\n",crypt(*toys.optargs ? *toys.optargs : toybuf, salt));
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/asn1/pkcs/
DPBEParameter.java18 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()
DMacData.java21 byte[] salt; field in MacData
44 this.salt = ((ASN1OctetString)seq.getObjectAt(1)).getOctets(); in MacData()
58 byte[] salt, in MacData() argument
62 this.salt = salt; in MacData()
73 return salt; in getSalt()
97 v.add(new DEROctetString(salt)); in toASN1Primitive()
DPBKDF2Params.java68 byte[] salt, in PBKDF2Params() argument
71 this.octStr = new DEROctetString(salt); in PBKDF2Params()
83 byte[] salt, in PBKDF2Params() argument
87 this(salt, iterationCount); in PBKDF2Params()
101 byte[] salt, in PBKDF2Params() argument
106 this(salt, iterationCount); in PBKDF2Params()
120 byte[] salt, in PBKDF2Params() argument
124 this(salt, iterationCount); in PBKDF2Params()
/external/openssh/openbsd-compat/
Dxcrypt.c66 xcrypt(const char *password, const char *salt) in xcrypt() argument
71 if (is_md5_salt(salt)) in xcrypt()
72 crypted = md5_crypt(password, salt); in xcrypt()
74 crypted = crypt(password, salt); in xcrypt()
77 crypted = bigcrypt(password, salt); in xcrypt()
79 crypted = crypt(password, salt); in xcrypt()
81 crypted = bigcrypt(password, salt); in xcrypt()
83 crypted = crypt(password, salt); in xcrypt()
Dport-uw.c57 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/boringssl/src/crypto/pkcs8/
Dp5_pbe.c70 ASN1_SIMPLE(PBEPARAM, salt, ASN1_OCTET_STRING),
80 const unsigned char *salt, int saltlen)
101 if (!ASN1_STRING_set(pbe->salt, NULL, saltlen))
106 sstr = ASN1_STRING_data(pbe->salt);
107 if (salt)
108 memcpy(sstr, salt, saltlen);
135 const unsigned char *salt, int saltlen) in PKCS5_pbe_set() argument
145 if (PKCS5_pbe_set0_algor(ret, alg, iter, salt, saltlen)) in PKCS5_pbe_set()
Dp5_pbev2.c79 ASN1_SIMPLE(PBKDF2PARAM, salt, ASN1_ANY),
115 unsigned char *salt, int saltlen, in PKCS5_pbe2_set_iv() argument
181 pbe2->keyfunc = PKCS5_pbkdf2_set(iter, salt, saltlen, prf_nid, keylen); in PKCS5_pbe2_set_iv()
218 unsigned char *salt, int saltlen) in PKCS5_pbe2_set() argument
220 return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1); in PKCS5_pbe2_set()
223 X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, in PKCS5_pbkdf2_set() argument
235 kdf->salt->value.octet_string = osalt; in PKCS5_pbkdf2_set()
236 kdf->salt->type = V_ASN1_OCTET_STRING; in PKCS5_pbkdf2_set()
245 if (salt) in PKCS5_pbkdf2_set()
246 memcpy (osalt->data, salt, saltlen); in PKCS5_pbkdf2_set()
Dpkcs8.c107 const uint8_t *salt, size_t salt_len, in pkcs12_key_gen_raw() argument
143 *p++ = salt[i % salt_len]; in pkcs12_key_gen_raw()
223 uint8_t *salt; in pkcs12_pbe_keyivgen() local
246 salt = pbe->salt->data; in pkcs12_pbe_keyivgen()
247 salt_len = pbe->salt->length; in pkcs12_pbe_keyivgen()
248 if (!pkcs12_key_gen_raw(pass_raw, pass_raw_len, salt, salt_len, PKCS12_KEY_ID, in pkcs12_pbe_keyivgen()
254 if (!pkcs12_key_gen_raw(pass_raw, pass_raw_len, salt, salt_len, PKCS12_IV_ID, in pkcs12_pbe_keyivgen()
490 int pass_len, uint8_t *salt, size_t salt_len, in PKCS8_encrypt() argument
507 salt, salt_len, iterations, p8inf); in PKCS8_encrypt()
518 uint8_t *salt, size_t salt_len, in PKCS8_encrypt_pbe() argument
[all …]
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/keystore/bc/
DBcKeyStoreSpi.java142 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/chromium-trace/trace-viewer/third_party/webapp2/webapp2_extras/
Dsecurity.py123 salt = method != 'plain' and generate_random_string(length) or ''
124 hashval = hash_password(password, method, salt, pepper)
128 return '%s$%s$%s' % (hashval, method, salt)
151 hashval, method, salt = pwhash.split('$', 2)
152 return hash_password(password, method, salt, pepper) == hashval
155 def hash_password(password, method, salt=None, pepper=None): argument
182 if salt:
183 h = hmac.new(webapp2._to_utf8(salt), password, method)
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/
DPBEParametersGenerator.java11 protected byte[] salt; field in PBEParametersGenerator
31 byte[] salt, in init() argument
35 this.salt = salt; in init()
56 return salt; in getSalt()
/external/jetty/src/java/org/eclipse/jetty/util/security/
DUnixCrypt.java328 private static long des_cipher(long in, int salt, int num_iter, long[] KS) in des_cipher() argument
330 salt = to_six_bit(salt); in des_cipher()
349 k = ((R >> 32) ^ R) & salt & 0xffffffffL; in des_cipher()
361 k = ((L >> 32) ^ L) & salt & 0xffffffffL; in des_cipher()
429 int salt = 0; in crypt() local
434 salt = (salt << 6) | (0x00ff & A64TOI[c]); in crypt()
437 long rsltblock = des_cipher(constdatablock, salt, 25, KS); in crypt()
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/generators/
DOpenSSLPBEParametersGenerator.java41 byte[] salt) in init() argument
43 super.init(password, salt, 1); in init()
59 digest.update(salt, 0, salt.length); in generateDerivedKey()
DPKCS12ParametersGenerator.java91 if ((salt != null) && (salt.length != 0)) in generateDerivedKey()
93 S = new byte[v * ((salt.length + v - 1) / v)]; in generateDerivedKey()
97 S[i] = salt[i % salt.length]; in generateDerivedKey()
/external/boringssl/src/crypto/evp/
Dpbkdf.c64 const uint8_t *salt, size_t salt_len, unsigned iterations, in PKCS5_PBKDF2_HMAC() argument
96 if (!HMAC_Update(&hctx, salt, salt_len) || in PKCS5_PBKDF2_HMAC()
130 const uint8_t *salt, size_t salt_len, in PKCS5_PBKDF2_HMAC_SHA1() argument
133 return PKCS5_PBKDF2_HMAC(password, password_len, salt, salt_len, iterations, in PKCS5_PBKDF2_HMAC_SHA1()
/external/scrypt/tests/
Dscrypt_test.cpp33 const char *pw, *salt; member
70 crypto_scrypt((const uint8_t*) s.pw, strlen(s.pw), (const uint8_t*) s.salt, in TEST_F()
71 strlen(s.salt), s.Nfactor, s.rfactor, s.pfactor, output, sizeof(output))) in TEST_F()
/external/boringssl/src/crypto/cipher/
Dderive_key.c70 const uint8_t *salt, const uint8_t *data, size_t data_len, in EVP_BytesToKey() argument
101 if (salt != NULL) { in EVP_BytesToKey()
102 if (!EVP_DigestUpdate(&c, salt, PKCS5_SALT_LEN)) { in EVP_BytesToKey()
/external/openssh/
Dmd5crypt.c45 is_md5_salt(const char *salt) in is_md5_salt() argument
47 return (strncmp(salt, magic, strlen(magic)) == 0); in is_md5_salt()
51 md5_crypt(const char *pw, const char *salt) in md5_crypt() argument
61 sp = salt; in md5_crypt()
/external/scrypt/patches/
Duse_openssl_pbkdf2.patch22 + PKCS5_PBKDF2_HMAC((const char *)passwd, passwdlen, salt, saltlen, 1, EVP_sha256(), p * 128 * r, B…
24 PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, p * 128 * r);
62 + PKCS5_PBKDF2_HMAC((const char *)passwd, passwdlen, salt, saltlen, 1, EVP_sha256(), p * 128 * r, B…
64 PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, p * 128 * r);
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/spec/
DPBKDF2KeySpec.java24 …public PBKDF2KeySpec(char[] password, byte[] salt, int iterationCount, int keySize, AlgorithmIdent… in PBKDF2KeySpec() argument
26 super(password, salt, iterationCount, keySize); in PBKDF2KeySpec()
/external/toybox/lib/
Dpassword.c10 int get_salt(char *salt, char *algo) in get_salt() argument
20 char *s = salt; in get_salt()
40 salt[len] = 0; in get_salt()
42 return s-salt; in get_salt()
/external/wpa_supplicant_8/src/tls/
Dpkcs5.c23 u8 salt[8]; member
103 os_memcpy(params->salt, hdr.payload, hdr.length); in pkcs5_get_params()
106 params->salt, params->salt_len); in pkcs5_get_params()
152 addr[1] = params->salt; in pkcs5_crypto_init()

1234