General Password Security && Implementation in Actionscript 3

只谈情不闲聊 提交于 2019-12-04 23:14:22

A generally excepted way of sending password is to not actually send them at all, as this is considered highly insecure. Instead as you've mention you send a different form of them such as the hashed password, althought this still has some draw backs - i.e. rainbow tables etc.

Therefore the best approach is to hash the password with a nonce (number only used once) i.e. a random string and a timestamp and send that instead. I would then send the hashed string, the nonce and the timestamp in an xml format to your db server who could then try and reproduce the hashed password using the password you have stored for the user.

This is how the W3C usernameToken spec do it. see - http://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-os-UsernameTokenProfile.pdf

<UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd">
  <Username>jon</wsse:Username>
   <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">9JSGeXj+zpvEp42I20K/1bg8rCE=</Password>
   <Nonce>TaF3g5F37wSHtSdY</Nonce>
   <Created>2009-07-25T10:29:34Z</:Created>
</UsernameToken>

However, this may introduce unwanted complexity.

So you could simply just hash the password and send it to the server who would then hash its version of the password and if it matched your away. Although at the end of the day, you have to ask your self how secure is the actual .swf file becuase you can decompile them and just jump over the original login anyway. However, for this most part this will be sufficient.

To hash stings i usually use as3crypto (code.google.com/p/as3crypto/) - but I know the abode utils package has a md5 and sha-1 implementation.

As for the xml socket this will be fine as long as you have a cross-site-policy file in the action script app that allows it to talk to that domain and one on the domain that allows flash to talk to it. otherwise you may get security errors.

Hope this helps.

Jon

Here is a link about encrypting in md5 with ActionScript (I just googled it), since is the most commonly used encryption algorythm. You should not encrypt it in the server, but use a secure connection to the database, and compare what is encrypted in the message to the encrypted password in the database.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!