Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    7

    Unanswered: Help! password column in Sybase 12.5

    Is it possible to define a column that will contain encrypted password in Sybase 12.5
    How should I save it & how should it be accessed.

    Thanks

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    G'day

    While going thro http://www.sybase.com/detail?id=1023904, I found that Sybase has a function called internal_encrypt.

    So I played with it.
    1> declare @crypt varchar(255)
    2> select @crypt = internal_encrypt("Hello World")
    3> select @crypt
    4> go
    (1 row affected)

    --------------------------------------------------------------------------------
    C&J&Ii>Q#O+

    Strangely I tried to decrypt it back with all possibilities of word combination. There doesn't seem to be any function that can decrypt. Looks like this is just one-way.

    I'm not sure, how useful this is for you. Check with Sybase Support if they have any decrypt function and do let us know here.

    Cheers,

    Willy

  3. #3
    Join Date
    Jan 2004
    Posts
    7
    Hi Willy,


    Thanks a lot! That was clever trick!!! I was planning to use image datatype, but didn't want to. Well, I inserted test data with internal_encrypt & retrieved it using internal_encrypt. It worked. Right now that is all I want.

    Thanks!!!

  4. #4
    Join Date
    Feb 2004
    Location
    UK
    Posts
    43
    I am trying to put the same functionality.Can u please let me know how u hv dcrypted the password.

  5. #5
    Join Date
    Jan 2004
    Posts
    7
    Here you go!

    insert into Manager values ("JohnDoe", "John Doe", "415-111-0000", "John.Doe@abc.com", "Prod manager", internal_encrypt("password"))

    Above statement will store the encrypted field in the database

    select * from Manager where password = internal_encrypt("password")

    In order to retrieve the value from database, pass encrypted input. It will retrieve the matching rows.

    Once you store this data, you can never decrypt it. You can just compare it with encrypted input.

  6. #6
    Join Date
    Jan 2004
    Location
    Shanghai,China
    Posts
    76
    Originally posted by Syb125User9
    Here you go!

    insert into Manager values ("JohnDoe", "John Doe", "415-111-0000", "John.Doe@abc.com", "Prod manager", internal_encrypt("password"))

    Above statement will store the encrypted field in the database

    select * from Manager where password = internal_encrypt("password")

    In order to retrieve the value from database, pass encrypted input. It will retrieve the matching rows.

    Once you store this data, you can never decrypt it. You can just compare it with encrypted input.
    yes,compare the encrypted input is safe.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •