I have heard about people by using this approach and want to understand what the implications are. I simply know it's an awful idea!
From things i understand, salting your password before storing the hash inside a DB has got the primary reason for making every hashing formula unique, and therefore needing a brand new rainbow table for each user when attempting to hack it.
How's a hash destabilized within this context when the plain text only agreed to be salted with itself?
A good example:
plainText = input(); saltedText = plainText + plainText; hashedText = hash(saltedText); db.store(hashedText);
And would the next approach have a similar weak points or other weak points?
plainText = input(); saltedText = hash(plainText) + plainText; hashedText = hash(saltedText); db.store(hashedText);
I believe you've misinterpreted the objective of the salt. The salt implies that exactly the same data, hashed two times would (usually) give two spun sentences. Jetski from attacks where understanding what values can produce a given hash provides you with the login to everybody who uses exactly the same password.
As a result copying the exam to become hashed won't provide you with any benefits apart from the perf hit of hashing more data.
Both in your techniques the salt is foreseeable, so just one rainbow table is required.
You need to use another salt any time you hash a string:
plainText = input(); salt = getRandomSalt(); hashedText = hash(salt + plainText); db.store(salt, hashedText);
Others have described the problems together with your implementation.
If you wish to derive a salt (to prevent requiring to keep one) you'll need another user unique source for that salt.
For instance AccountID, username, or current email address could be utilized for a salt source. Clearly you should not make use of the source straight because the salt rather make use of a key derivation function like PBKDF2.
Remember when the underlying salt source changes the password will have to be re-written. This is often implemented by asking the consumer for that password before altering key information (validate user after which use provided password to rehash w/ salt source).