Decrypting Hashes - hash

Does anybody know the best way to decrypt FreeBSD hashes? I've been running some through JTR all day now and I couldn't yield a result. Is there perhaps a way to convert a FreeBSD to a normal MD5 hash?
Here are the hashes:
$1$LW0BqrMo$7RdAC6dRWhoaSqf81WTDh.
$1$lz2DS3Vy$wxNOu1EBHrcDCYAXbiSLl1
$1$IZSaO//a$0yQcAar4HV/c0ocR7dhnR.
$1$FeUvbH85$poEAS/Nnf/vbRGTzgHtEu.
$1$bMajRVwN$PxIf0SlT16Pt/igAgHeMe1
Thanks.

I ran your hashes through hashcat, and I got the correct original strings. They're listed here:
$1$LW0BqrMo$7RdAC6dRWhoaSqf81WTDh.:ethernets
$1$lz2DS3Vy$wxNOu1EBHrcDCYAXbiSLl1:cyptography
$1$IZSaO//a$0yQcAar4HV/c0ocR7dhnR.:bandwidths
$1$FeUvbH85$poEAS/Nnf/vbRGTzgHtEu.:domains
$1$bMajRVwN$PxIf0SlT16Pt/igAgHeMe1:symmetric
May I ask what you need them for?

Because FreeBSD is a hashing algorithm and not an encryption algorithm, you can't decrypt it: hashing is one-way.

The $1$ in front of the password indicates it is using an MD5 hash. See crypt(3).
As cracker286 demonstrated, those are easy to crack. In FreeBSD 9.x at least the default is to use SHA512 instead of MD5. See login.conf.
Existing FreeBSD installations should update /etc/login.conf to switch to SHA512 password hashing and notify the users to change their passwords.

$1$FeUvbH85$poEAS/Nnf/vbRGTzgHtEu.:domain
$1$bMajRVwN$PxIf0SlT16Pt/igAgHeMe1:ethernet
$1$IZSaO//a$0yQcAar4HV/c0ocR7dhnR.:cryptography
$1$lz2DS3Vy$wxNOu1EBHrcDCYAXbiSLl1:bandwidth
$1$LW0BqrMo$7RdAC6dRWhoaSqf81WTDh.:asymmetric

Related

AES based non-cryptographic hash algorithm

Is there an AES based non-cryptographic hash algorithm?
I think this could be useful, as we have AES-NI instructions, such a hash could be very fast.
I'd like to use this for fingerprinting (so its output should be at least 128-bits) and error detection purposes.
(I've googled for this, but all I found is cryptographic hashes)
MeowHash is a new (still not officially released) AES-NI-based hash function that is extremely fast and appears to be very robust for the functions you mentioned (but not cryptography):
Write-up: https://mollyrocket.com/meowhash
Repo: https://github.com/cmuratori/meow_hash

How do I get the initialization vector (iv) from OpenSSL encrypted data

Disclaimer: New to cryptography.
I have an external process that uses OpenSSL to encrypt data, which right now, uses a salt.
An iPhone app grabs that data from a server, downloads it to the app's documents directory, and needs to decrypt it. The iPhone OS does not include the OpenSSL library. You can build it yourself, but it's difficult and tricky. The "easiest" solution I've found, thanks to Stackoverflow's help, is to use CommonCrypto/CommonCryptor.h which is part of the Security Framework.
But the C function to decrypt data needs an iv to correctly decrypt.
Is there a way to derive the iv from the encrypted data (which, to me, seems like it would negate the extra security)? Or do I need to, first, specify the iv somehow and let the iPhone app know what it is? Or, just don't use a salt?
Edit1: To clarify, I'm using OpenSSL to encrypt text in a data file. A script using OpenSSL encrypts the text, uploads to Dropbox, then the app downloads the file from Dropbox, parses it, and attempts to decrypt the text.
Edit2: Yes, I'm using the OpenSSL command line utility with the -pass option.
The IV should be chosen randomly for each message you encrypt. I assume you are using the OpenSSL command line utility, openssl enc, but it's not clear whether you are using password-based encryption (the -pass and -salt options) or specifying the key explicitly (the -K and -IV options).
For the best security, I recommend that you use the -K option, and randomly generate a new IV for each message. Send the IV along with the ciphertext. For example, you could append the ciphertext to the IV in one file, and then strip the IV from the beginning of the file when you are ready to decrypt.
The IV can be public; you don't have to hide it. The important thing is that you use an unpredictable IV for each message.
The iv can not be derived from the encrypted data, it must be either agreed on outside of the communications between the two sides or made public. Also depending on the encryption mode it may not be required, but CBC is the most common and does require an iv. The iv basically makes it harder to glean any information from the first block.
In your case you just need to figure out the iv, either it is static and just hard-code it or it it is transmitted, possibly in a pre-amble, figure out how to extract it from the data.
The iv may be as simple as 0.
One problem with SSL is trying to capture the packets. That can be done easily with the app Charles (link here), it has a free trial. I use it regularly.
Personally I use to compile OpenSSL for a wide variety of functionality, try this tuto http://www.x2on.de/2010/07/13/tutorial-iphone-app-with-compiled-openssl-1-0-0a-library/ really is simple.
Cheers!.

Should all implementations of SHA512 give the same Hash?

I am working on writing a SHA512 function. When i check the file I am encrypting on different sources, a Linux SHA512SUM tool, a couple websites, and run it through the old source code i have for SHA512, they all give different hash values. My thought going into this project is that all Hash algorithms will output the same hash value if implemented correctly, to be used as a check sum. Am I wrong in thinking this? If I am wrong how would I really check to see if my work is correct?
Thanks in advance.
Yes, that's one of the basic building block of PKI: the same data block passed to a hash should always return the same hash value.
beware of the interpretation, though: the result of a SHA-2(512) hash is a block of 512 bits, not a string value so it will first be encoded for human consumption and it is therefore possible that you see what looks like visually different results when it's simply a matter of using different encodings.

How does the Enterprise Library's CryptographyManager.CompareHash method work?

I've been wondering how the CryptographyManager is able to compare a salted hash with the plain text. It has to save the salt for each hash somewhere, right? Has anyone any insight on this?
We ship source code. Take a look at CryptographyManagerImpl.cs in the Cryptography solution.
Also, you may want to review our unit tests - the ones that start with HashProvider should give you additional insight.
So I checked out the source code and it is actually quite trivial: The salt is prepended to the actual hash value. When the hash is compared to a plaintext the salt is extracted and used to hash the plaintext. These two hash values (= salt + hash) are then compared.

What hashes are common hashes? used on the net and other programs?

I seen MD5 and SHA1 hashes on the net to verify files. What are common hashes used on the net and other programs? This is to verify a file not to hash a pw.
I've used some hash functions from the following site before - they are usually pretty quick, and full code is given on the website, and a description of each of the functions and their strengths/weaknesses:
http://www.partow.net/programming/hashfunctions
Examples of the hashes given are - Kernighan and Ritchie (from "The C Programming Language") and the Knuth hash (from "The Art Of Computer Programming Volume 3").
To verify files you can use cyclic redundancy checks, such as CRC32, which have been as far as I know the de-facto standard for hashing files for a long time in the IT, if you want to look at other stuff than MD5/SHA.
See also this list of checksum algorithms for more ways to check your files.
I never used anything else than MD5. Add a Salt if you use it for passwords.
Wikipedia has a list of hash functions, broken up into different types (checksums, non-crypto, crypto etc).
The Apache Foundation (among others) uses PGP Signatures.