# Question about Servoy security

**URL:** <https://forum.servoy.com/t/question-about-servoy-security/13163>\
**Category:** Classic Servoy\
**Created:** [November 9, 2010, 3:13pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163 "2010-11-09T15:13:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![guerry](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@guerry](https://forum.servoy.com/u/guerry)\
**Post date:** [November 9, 2010, 3:13pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/1 "2010-11-09T15:13:52Z")

</div>

Hi,

I’m new to servoy, and have trawled the forums looking for an answer to the following question. I saw from this post ([http://forum.servoy.com/viewtopic.php?f=5&t=12472](http://forum.servoy.com/viewtopic.php?f=5&t=12472)) that Servoy stores passwords using a one-way, irreversible hash. Is the hash algorithm a known, standard published one, such as the salted password approaches used on Unix/Linux?

I am contemplating using an external authentication scheme, but want to be able to migrate existing users and passwords to the external system. Therefore, I need to be able to carry the existing password encryption scheme with me (just one among several options).

Much thanks in advance.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [November 11, 2010, 11:40am UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/2 "2010-11-11T11:40:01Z")

</div>

this is the code that creates the hash of the passwords:

```auto
public static String calculateMD5HashBase64(String password)
	{
		String result = null;
		try
		{
			MessageDigest md = MessageDigest.getInstance("MD5"); //$NON-NLS-1$
			byte[] hash = md.digest(password.getBytes("UTF-8")); //$NON-NLS-1$
			result = encodeBASE64(hash).trim();
		}
		catch (Exception e)
		{
			Debug.error(e);
		}
		return result;
	}

```

so it is MD5 and then base64 encoded.

---

<div class="post-metadata">

**Author:** ![guerry](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@guerry](https://forum.servoy.com/u/guerry)\
**Post date:** [November 11, 2010, 5:07pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/3 "2010-11-11T17:07:08Z")

</div>

Excellent! Much thanks!

---

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [November 12, 2010, 3:27pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/4 "2010-11-12T15:27:01Z")

</div>

Any reason you have chosen not to salt the hash?

It’s common practice to store password hashes with something like… hash = md5 ( ( password + salt ) + salt )

---

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [June 29, 2011, 2:17pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/5 "2011-06-29T14:17:50Z")

</div>

Any update to how this is done? plain MD5 without a salt has long been considered broken for password hashing.

[http://www.kb.cert.org/vuls/id/836068](http://www.kb.cert.org/vuls/id/836068)  
[http://en.wikipedia.org/wiki/Rainbow\_table](http://en.wikipedia.org/wiki/Rainbow_table)  
[http://www.freerainbowtables.com/](http://www.freerainbowtables.com/)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 29, 2011, 2:26pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/6 "2011-06-29T14:26:51Z")

</div>

we can’t just change it… That would break all existing solutions that uses existing users/password combinations.

Please create a case for this if you want to use MD5+salt or SHA, i guess this must then be a system setting somewhere where you can switch…

---

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [June 12, 2012, 1:15pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/7 "2012-06-12T13:15:43Z")

</div>

I noticed revs 5807 & 5823 in the trunk, and from the commit message and corresponding code they seem to address the issue of storing passwords as MD5 hashes. The reference a ticket (SVY-319) that is not publicly accessible, so can you confirm that this will be upcoming in servoy 6.1?

[https://www.servoyforge.net/projects/se … sions/5807](https://www.servoyforge.net/projects/servoy/repository/revisions/5807)  
[https://www.servoyforge.net/projects/se … sions/5823](https://www.servoyforge.net/projects/servoy/repository/revisions/5823)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 19, 2012, 12:14pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/8 "2012-06-19T12:14:34Z")

</div>

yes from now on new passwords will be stored by a different hashing algo: [http://en.wikipedia.org/wiki/PBKDF2](http://en.wikipedia.org/wiki/PBKDF2)

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [June 19, 2012, 12:51pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/9 "2012-06-19T12:51:55Z")

</div>

Johan,

doesn’t this break existing solutions as you mentioned in in this topic before?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 19, 2012, 12:57pm UTC](https://forum.servoy.com/t/question-about-servoy-security/13163/10 "2012-06-19T12:57:50Z")

</div>

no because we store in the database which kind it is  
so by default we expect the old MD5  
but if we see a new entry (having a specific prefix) we know it is the new way.  
And all new passwords (when you create a new user/pw or update an existing pw) the new way is used and the hash has the new prefix
