Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Translate the entire conversation x

PASSWORD field unable to import

MA8731174
14-Alexandrite

PASSWORD field unable to import

Hello Experts,

     I  have datatable with usercredentials stored in it and one of the field (loginPassword) is of password type which i do hash also before saving it.

 

 

 

 

result.AddRow({
	loginName: loginName.toUpperCase(),
	firstName: firstName,
	lastName: lastName,
	language: language,
	emailAddress: emailAddress.toLowerCase(),
	hashedLoginName: me.SHA256({
		toHash: loginName.toUpperCase()
	}),
	groups: groups,
	loginPassword: Resources["EncryptionServices"].EncryptPropertyValue({
		data: me.SHA256({
			toHash: loginPassword
		})
	})
});

 

 

 

 

Now the issue is when i import this datatable to different server then the values of this field only just does not come on the new server even though other datafields are there. Its like you cannot import the field only because the basetype is password. 

 

My query:-

 

1) Is there any way with which i can import this field also to another server?

2) If i change this field to string before import and also string onto new server then this field also get imported but then this password does not work as it feels like its different hasing...

 

Any solution in this regard?

 

My goal is to only take these passwords on to new server thats it. 

@Rocko  any suggestions in this regard?

 

 

 

 

 

 

 

 

 

 

 

3 REPLIES 3
MA8731174
14-Alexandrite
(To:MA8731174)

Hi, I have a datatable and one of the field is of type PASSWORD , now i edit the field and choose string for it and i can see encrypt value of this field ...and i am saving the value in datatable using  Resources["EncryptionServices"].EncryptPropertyValue(params) and now i want to see the original values of these fields. Is there any way that i can see the original values? I have written a service to get the entries as a REST API and then iterate each entry and get the field password as one long string and using ACCEPT / also but for me its still coming the same encrypted values what it shows in datatable.

 

 

 

 

my code to add password

 

result.AddRow({
loginName: loginName.toUpperCase(),
firstName: firstName,
lastName: lastName,
language: language,
emailAddress: emailAddress.toLowerCase(),
hashedLoginName: me.SHA256({
toHash: loginName.toUpperCase()
}),
groups: groups,
loginPassword: Resources["EncryptionServices"].EncryptPropertyValue({
data: me.SHA256({
toHash: loginPassword
})
})
});

Hi @MA8731174 

Thank you for your question!

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant.

 

Thanks for using the Community!

 

Best regards,

Catalina
PTC Community Moderator

With datatable content there is no "universal export" option which decrypts the password before export.

 

That is why the documentation says under "Best Practices for Importing and Exporting Passwords":

When importing and exporting passwords, use the default export system, and ensure the same keystore is installed on the system doing the import.
 
So if you have the same keystore, this should work.
Changing it to String will have no effect as it will not decrypt the value. A different keystore uses a different key that is why you can't just copy it to another system with a different keystore.
if you can't use the same keystore, don't use passwords in a datatable. Maybe SHA256 hashing should provide enough security for your usecase?
In the end some one would have to have access to the database to get the hashes for a collision attack, but when they can access the database, the collision attack it the least of your problems.
 
 

 

Announcements


Top Tags