Usuario & Contraseña

57 views
Skip to first unread message

Gil Lopez

unread,
Jan 20, 2010, 7:37:01 PM1/20/10
to Desarrollo de Componentes en Adobe Flex
Hola buenas tardes quisiera saber si saben como puedo validar a un
usuario, ahora bien, estoy usando una bd en sql express y lo que
necesito es validar al usuario y su contraseña, lo que no se si sea
mejor que los datos esten en una tabla o que sean usuarios de sql.
Y tambien como hacer para que esos datos (user/pass) no sean enviados
en texto plano, es decir, usar algun tipo de encriptado aunque sea muy
sencillo.

Saludos y gracias por su ayuda.

Gil Lopez

Jorge Cordero

unread,
Jan 20, 2010, 11:52:54 PM1/20/10
to Desarrollo de Componentes en Adobe Flex
Estimado Gil
Yo prefiero guardar la informacion de mis usuarios en una tabla
de SQL, el usuario en texto y el password hash
de forma que al enviar los datos de la forma uso el mismo algoritmo
que use en el registro de usuarios
si se localiza el registro en la base regreso un XML con los datos
del usuario para inicialisar un new Usuario()

para mayor informacion de esto checa
http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps_12.html

Saludos

Jorge Cordero
FLEX HELP google group

Diego Augusto Pinzon Carreño

unread,
Jan 21, 2010, 8:56:38 AM1/21/10
to desarrollo-de-compo...@googlegroups.com
flash.data.EncryptedLocalStore class

puede servirte , pero si deseas una conexion socket encriptada en su totalidad tendras que esperar a air 2.0.
 
aquii te dejo un aparte de un libro; adobe air in action.

    All data written to a secure data storage area using EncryptedLocalStore is
encrypted using AES-CBC 128-bit encryption. Again, EncryptedLocalStore takes care
of the encryption and decryption. All you need to do is call the correct methods and
pass them the correct parameters. We’ll look at these methods in a moment. First we
need to look at how the data is stored.

    Each piece of data in the encrypted data storage area is identified by a unique key.
The key is a string that we can use to retrieve the data. For example, if you want to
store an email server password, it might make sense to use a key such as emailServer-
Password. The keys you use are arbitrary, but it’s usually a good idea to use names that
clearly indicate what the value is. Each key points to a piece of data that you store
using EncryptedLocalStore, and that piece of data is stored as a flash.utils.Byte-
Array object. If you’re not familiar with the ByteArray class, there’s no reason to
panic. It implements the IDataInput and IDataOutput interfaces—the same inter-
faces implemented by FileStream. That means you can write and read data to and
from a ByteArray object just as you would a FileStream object. For example, the fol-
lowing code constructs a ByteArray object and then writes an array of strings to it
using the writeObject() method:

   var array:Array = new Array("a", "b", "c", "d");
   var byteArray:ByteArray = new ByteArray();
   byteArray.writeObject(array);
                                     

    When you want to write data to the data store, all you need to do is call the static
    EncryptedLocalStore.setItem() method. The staticItem() method requires that
    you give it two pieces of information: the key and the data (in the form of a ByteArray
    object). The following example writes a password value using setItem():

       var byteArray:ByteArray = new ByteArray();
       byteArray.writeUTFBytes("j8ml08*1");
       EncryptedLocalStore.setItem("emailServerPassword", byteArray);

    Once you’ve written data to the data store, it’s likely that at another time you’ll want
    to retrieve that data. You can do that using the getItem() method. The getItem()
    method requires that you tell it the key of the data you want to retrieve. It then
    returns a ByteArray object with the data. The following example retrieves the email
    server password:

       var byteArray:ByteArray =
       ➥EncryptedLocalStore.getItem("emailServerPassword");
       var password:String= byteArray.readUTFBytes(byteArray.length);

    What if you want to remove data from the data store? Not a problem. Encrypted-
    LocalStore provides two static methods for accomplishing that: removeItem() and
    reset(). The removeItem() method removes an item given the key. For example, the
    following will remove the email server password from the data store:

       EncryptedLocalStore.removeItem("emailServerPassword");
    The reset() method removes all data from the data store:
       EncryptedLocalStore.reset();

    We’ve wrapped up all the core theoretical information, so we have just one more
    thing to do in this chapter, which is to add to our AirTube application by integrating
    some of the file system knowledge we just learned.

tambien tenemos esta componente    http://ascrypt3.riaforge.org/ tiene ejemplor claros. espero que te sirva
saludos.

--
Has recibido este mensaje porque estás suscrito al grupo "Desarrollo de Componentes en Adobe Flex" de Grupos de Google.
Para publicar una entrada en este grupo, envía un correo electrónico a desarrollo-de-compo...@googlegroups.com.
Para anular tu suscripción a este grupo, envía un correo electrónico a desarrollo-de-componentes...@googlegroups.com
Para tener acceso a más opciones, visita el grupo en http://groups.google.com/group/desarrollo-de-componentes-en-adobe-flex?hl=es.




Diego Augusto Pinzon Carreño

unread,
Jan 21, 2010, 9:09:02 AM1/21/10
to desarrollo-de-compo...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages