Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

PHP encryption method

I have an encryption method that has the following behavior: each character of the password is put through a method that gets the ASCII value of that character and shifts the bytes one way, and then the other way, and returns the following:

$shifted_left.$original_char.$shifted_right.

An example of a password before it is hashed:

àp8Âa0æs9æs9îw;Þo7är9Èd2Îg3Þo7Êe2æs9Ðh4Êe2är9Êe2d2

After this, the resultant string formed from going through each character in the original password is hashed using BCrypt. Does surrounding the passwords with these junk characters improve the strength of the passwords or protect them from being cracked via rainbow tables/dictionary attack?

Answer*

Draft saved
Draft discarded
Cancel
3
  • True.. but, since the password being hashed isn't actually the password, but the jumbled string, doesn't that mean if they were to attempt a brute force attack, they wouldn't be able to actually crack any of the passwords since the real password isn't stored? Commented Jul 12, 2012 at 7:10
  • When an attacker break in your server (or wherever your code is), he/she know how you build you hash-string. There is no magic, so an attacker can brute-force the hashes very soon... Commented Jul 12, 2012 at 7:16
  • @SHH If they'd attempt to brute-force your data, they'd need to know your particular algorithm anyway. It's not really possible to tell from looking at a hash what algorithm was used. If your database is compromised so that your hashes are leaked, simply assume that the algorithm is leaked with it since the attacker has access to your server. Commented Jul 12, 2012 at 7:21

lang-php

AltStyle によって変換されたページ (->オリジナル) /