crypt

What is the output length of PHP crypt()? [closed]

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: what's the output length of PHP crypt() ? md5() output is 128 bits and produce a string with 32 chars, so in data base you put that in a char(32) column, what about the crypt() ? 回答1: Note: It is totally limited to ask the question that way, see http://php.net/crypt Some more details: On success the length of the returned string can vary between 13 and 123. The output length depends on the hash algorithm used. It remains undefined in your question. The output length depends on the salt passed to the function. It remains undefined in your

Given a linux username and a password how can I test if it is a valid account?

寵の児 提交于 2019-12-03 05:48:59
问题 So my question is straight forward given a linux username and a password how can I test if it is a valid account? 回答1: You can validate that a given password is correct for a given username using the shadow file. On most modern distributions, the hashed passwords are stored in the shadow file /etc/shadow (which is only readable by root). As root, pull the line from the shadow file for the given user like so: cat /etc/shadow | grep username You will see something like this: username:$1

Rfc2898DeriveBytes in java

人走茶凉 提交于 2019-12-03 04:38:34
问题 I am trying to implement the following code in java: var keyGenerator = new Rfc2898DeriveBytes(password, salt, 1000); byte[] key = keyGenerator.GetBytes(32); byte[] iv = keyGenerator.GetBytes(16); using (AesManaged aes = new AesManaged()) { using (ICryptoTransform encryptor = aes.CreateEncryptor(key, iv)) { byte[] result = encryptor.TransformFinalBlock(content, 0, content.Length); } } By using the following one: SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");

Get timestamp from Authenticode Signed files in .NET

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We need to verify that binary files are signed properly with digital signature (Authenticode). This can be achieved with signtool.exe pretty easily. However, we need an automatic way that also verifies signer name and timestamp. This is doable in native C++ with CryptQueryObject() API as shown in this wonderful sample: How To Get Information from Authenticode Signed Executables However we live in a managed world :) hence looking for C# solution to the same problem. Straight approach would be to pInvoke Crypt32.dll and all is done. But there

Unable to sign a file with nodejs crypto

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've created a private Key with nodejs crypto and want to sign a file with this key. My code is following: var ecdh = crypto.createECDH('brainpoolP512t1'); ecdh.generateKeys(); var key = ecdh.getPrivateKey('buffer'); var data= fs.readFileSync(req.file.path); var sign = crypto.createSign('sha512'); sign.update(data); var signature = sign.sign(key, 'hex'); But I get the error: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line at Error (native) at Sign.sign (crypto.js:283:26) at /....js:32:27 at Immediate.<anonymous> (/.../node

How do I resolve the “Crypt Kicker” exercise proposed in “Programming Challenges (The Programming Contest Training Manual)”?

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: "Programming Challenges (The Programming Contest Training Manual)" is probably one of the nicest exercises book on algorithms. I've resolved the first 11 exercises, but now I am stuck with "Crypt Kicker" problem: Crypt Kicker A common but insecure method of encrypting text is to permute the letters of the alphabet. In other words, each letter of the alphabet is consistently replaced in the text by some other letter. To ensure that the encryption is reversible, no two letters are replaced by the same letter. Your task is to decrypt

What are the correct settings for crypto.pbkdf2 to derive IV and key to crypto.createCipheriv?

匿名 (未验证) 提交于 2019-12-03 00:54:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In an application in node.js, I am using crypto module for symmetric encryption/decryption. I am using AES-256-CTR. I originally assumed the crypto.createCipher will be "just working" and "handwaved" the details. Now I am reading in the documentation: Note: createCipher derives keys with the OpenSSL function EVP_BytesToKey with the digest algorithm set to MD5, one iteration, and no salt. The lack of salt allows dictionary attacks as the same password always creates the same key. The low iteration count and non-cryptographically secure hash

SHA256-CRYPT / SHA512-CRYPT in node.js

无人久伴 提交于 2019-12-02 20:26:13
问题 I use dovecot as my mail transfer agent and I aim to use the strongest password scheme which is supported by my system: SHA512-CRYPT or SHA256-CRYPT (BLF-CRYPT doesn't work). For my own written webinterface I look for a function or library in node.js for hashing a password (with SHA***-CRYPT). 回答1: You may consider checking: https://github.com/mvo5/sha512crypt-node which contains a implementation for sha512crypt in JS. Its very new but passes the testvectors from the glibc reference

Given a linux username and a password how can I test if it is a valid account?

痞子三分冷 提交于 2019-12-02 19:10:29
So my question is straight forward given a linux username and a password how can I test if it is a valid account? You can validate that a given password is correct for a given username using the shadow file. On most modern distributions, the hashed passwords are stored in the shadow file /etc/shadow (which is only readable by root). As root, pull the line from the shadow file for the given user like so: cat /etc/shadow | grep username You will see something like this: username:$1$TrOIigLp$PUHL00kS5UY3CMVaiC0/g0:15020:0:99999:7::: After the username there is $1. This indicates that it is an MD5

PDO Register and Login Password Matching

 ̄綄美尐妖づ 提交于 2019-12-02 17:10:57
问题 Okay.. so to start off I only have Php 5.3 so I can't use bcrypt, I am not familiar with salt but an completely willing to do it if someone can help me out. I also would like to know if this script is bad or good for sql injections. My biggest problems is when I use something like crypt and try to get my passwords to match, it won't. I've been working on this for days and can't seem to find the right solution to my problem. the code is not done yet, but its able to run. I'm just doing this on