Is there a feature in SQL Server that makes the values we give for "passwords" encrypted/encoded? If not, what is the simplest way to encode my passwords and store them in a table?
There is a function called PWDENCRYPT that will help you do this
Related
I want to decrypt password in SQL Server 2012 using DES to send that password in the mail using a SQL Server job.
Can anyone help me?
Thanks in advance.
You shouldn't really be de-encrypting passwords. And either not send passwords thru the emails!
And no, there's usually a random salt in the encryption, so you cannot decrypt it like that. Only Brute Force, because it's weak encryption method nowadays.
For Brute Force you can use for example pwdcompare - More at MSDN pwdcompare
Have a good day everybody, I'm working with SQL SERVER 2008, developing a simple login. Now I'm encrypting the password with this funtion
SUBSTRING(sys.fn_sqlvarbasetostr(HASHBYTES('MD5', #cont)),3,32)
It's work perfect, if I put pass = 123 then return 202cb962ac59075b964b07152d234b70, but I need to know how to decrypt and return again 123
I hope somebody can help me, Thanks
MD5 is a hash, its like an Identifier of a value, so it might or might not contain the actual data.
I start working on an old software of which I just forget the password. I go through the SQL Server 2008 database and found it is saved in the encrypted form
0xA77F9B75A183A3836540FBBE11963F771ED41BBE
there. I want to decrypt the password column and want to know the real password. So that I can access my application.
Thanks in advance
therewere no way you can decrypted, but if MD5 you could try the fallowing http://www.md5online.org/ they will cracked for you. but if you were unhappy with this answer and your programm is valuable for, try this http://www.devart.com/dbforge/sql/sqldecryptor/
Once again with the charset issues when talking to DB's :)
I have two enviroments running Zend Server. Bot of these communicate to a SQL Server 2000 using the mssql extension. None of them has any value given for the charset in the settings of the extension. For one it works and for the other one it returns data in the wrong encoding.
The problem became noticed when this data was beeing inserted into a MySQL database and it screamed with SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF6m' for column 'cust_lastname' at row 1.
I tried using SET NAMES utf8 to get the SQL Server connection to return the correct data, but it complains and says that NAMES is not a recognized SET statement. Looking around most people even recommend using this but it doesn't seem to be part of SQL Server 2000 :)
So, what should I do? How do I, WITHOUT fiddling with the SQL Server database/tables, tell it to send me the data in UTF-8 encoded format?
EDIT:
Some more info...
SQL Server uses the Finnish_Swedish_CI_AS collation
MySQL has every table in UTF-8 format and uses utf8_unicode_ci
I didn't find a good solution and ended up converting to and from utf8 in my application. If this is encapsulated within a class it doesn't riddle the code. But a way to actually tell the SQL server which encoding to use during communication would be better.
Every SQL Server connection string I ever see looks something like this:
Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database;
Integrated Security=SSPI;
Do I need the Initial Catalog setting? (Apparently not, since the app I'm working on appears to work without it.)
Well, then, what's it for?
If the user name that is in the connection string has access to more then one database you have to specify the database you want the connection string to connect to. If your user has only one database available then you are correct that it doesn't matter. But it is good practice to put this in your connection string.
This is the initial database of the data source when you connect.
Edited for clarity:
If you have multiple databases in your SQL Server instance and you don't want to use the default database, you need some way to specify which one you are going to use.
Setting an Initial Catalog allows you to set the database that queries run on that connection will use by default. If you do not set this for a connection to a server in which multiple databases are present, in many cases you will be required to have a USE statement in every query in order to explicitly declare which database you are trying to run the query on. The Initial Catalog setting is a good way of explicitly declaring a default database.