![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Member Level 3 | here is a simple program is wrote for one of my projects to encript data in MS SQL Server (same version is written in oracle too). CREATE FUNCTION EncryptPassword ( @Password as varchar(255) ) RETURNS varchar(255) AS BEGIN DECLARE @PasswordEncrypted as varchar(255) DECLARE @PasswordLength as int DECLARE @iPOS AS int DECLARE @XOR AS int --Ensure password IS NOT case-sensitive SET @Password = lower(@Password) --Only encrypt IF parameter IS NOT NULL IF @Password IS NOT NULL BEGIN SET @PasswordLength = len(@Password) -- CREATE the KEY using a combination the the lenth OF the password + the pos of the first 'e' found in the PW. -- (The 'e' IS the most commonly used letter IN the alphabet) SET @XOR = @PasswordLength + charindex(@Password,'e') SET @iPOS = 1 SET @PasswordEncrypted = '' WHILE @iPOS <= @PasswordLength BEGIN SET @PasswordEncrypted = @PasswordEncrypted + char(Ascii(substring(@Password, @iPOS, 1)) ^ @XOR) SET @iPOS = @iPOS + 1 END END --If @Password parameter IS NULL THEN do nothing IF @Password IS NULL BEGIN SET @PasswordEncrypted = NULL END RETURN @PasswordEncrypted END | ||
| | |
| Advertisements |
| Featured Websites | ||||
|
![]() |
| Tags: encription, server, sql |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Encription in Oracle | eric | Database | 2 | 07-16-2006 5:50 AM |
| Encription in mysql | eric | Database | 2 | 07-16-2006 5:49 AM |
| Best dedicated server hosting? | exam | Web Site Hosting | 5 | 05-04-2006 9:51 PM |
| Featured Websites | ||||
|