How to generate a CSV with Decrypted password

A forum where issues related to the DataPort utility can be discussed.
Post Reply
User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

How to generate a CSV with Decrypted password

Post by mazhar » Fri Feb 20, 2009 6:51 am

The sample project is a demonstration of CSV processing. This sample explains if you have Users CSV file with encrypted passwords and wants to generate clone of that CSV with decrypted passwords the how to do this job.The sample interface ask the user to provide the text qualifier, delimiter, password field name and source csv file. When user try to generate CSV version with decrypted password it asks the user for output csv file name and location. In order to decrypt your password you need to properly implement DecryptPassword method of the Sample.
Image

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: How to generate a CSV with Decrypted password

Post by mazhar » Fri Feb 27, 2009 12:23 pm

In order to create some CSV file first you need is to define is headers and then the reecords.
For example if you want to have a CSV file with UserId and UserName. In the very first line of CSV file you need to specify the headers separated by (,) and headers text quoted in double quotations and then all below lines will contain data in same format for example if you want to create a CSV file with one user record named mazhar with userid 1 then it would be something like below.

"UserId","UserName"
"1","mazhar"

Please check the attached CSV file for sample user CSV .

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: How to generate a CSV with Decrypted password

Post by Naveed » Fri Feb 27, 2009 12:34 pm

One important thing when creating CSV data if you want to import some users for which the "UserId" field have no value (a new user and you want UserId value automatically assigned), then use the zero value for this field. Like:

"UserId","UserName"
"0","mazhar"

This way a new user record will be created and automatically a new available UserId value will be assigned.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: How to generate a CSV with Decrypted password

Post by Brewhaus » Sat Feb 28, 2009 9:22 am

When using DataPort to import customers, will the UserID automatically start at the first available number and put all users in consequentially after that? In other words, if we import 1000 users, and the next available UserID after all active temporary ID's in the table is 82000, will it import the new users starting at 82001 and proceed to 83001, or will it start with the first available number (including any 'expired' user ID's that have become available), and leave gaps in the imported user ID's?

If the latter is true, then we will have to copy and paste the users into the table so that we will know each customers' ID in advance, as we also intend to import their order history from our previous software. The only disadvantage to this is that we cannot import passwords, as they will not be encrypted. This means having to default every current customer to a default password, which may upset some.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: How to generate a CSV with Decrypted password

Post by Naveed » Sat Feb 28, 2009 11:03 am

Brewhaus wrote: as we also intend to import their order history from our previous software.
If you only want to import users then it is better to use the value "ZERO" for UserId field. However as it seems you are planning to import respective orders for each user as well then it is better to use the original old value for UserId field.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: How to generate a CSV with Decrypted password

Post by Brewhaus » Sat Feb 28, 2009 2:43 pm

So, we can force the UserID? In other words, as long as we do not conflict with an existing UserID, we can specify the UserID that we want used? That makes life much easier.

As we do not have the encrypted password, if we leave the EncryptedPassword field blank, and put in a text password in the PlainTextPassword field, with these passwords get encrypted upon importing? If so, we can create new passwords for customers based on their last name, and not have to use a default password that will be common to all users that we import.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: How to generate a CSV with Decrypted password

Post by Brewhaus » Sun Mar 01, 2009 9:05 am

Even with the users.csv file above we get the same error- password field cannot be blank.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: How to generate a CSV with Decrypted password

Post by mazhar » Mon Mar 02, 2009 3:16 am

That was just a sample to give you an idea of CSV. You need to tell the application about the CSV's field that keeps the password information. If the CSV contains the password information in UserPassword field then on the GUI you need to tell that field name to the application.
For example if you exported the users information from your old database in CSV format that is something like

UserId,FirstName,LastName...............................................,MyPassword
0,mazhar,mazhar.............................................................,&6777jjh

Then when you run the sample you first you need to tell the application that which field contains the encrypted password information so just specify the Password Field Name value to MyPassword.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: How to generate a CSV with Decrypted password

Post by Brewhaus » Mon Mar 02, 2009 8:03 am

When I try to run the import I have all fields in the CSV file linked to the field that DataPort should be importing them into. I believe this is what you mean. Correct me if I am wrong.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Post Reply