decrypting an int value

  • I'm not getting the exact value when i tried to decrypt the encrypted value if i use int value.

    SELECT seed_time,seed_encrypt,

    CONVERT(int,DecryptByPassphrase(@pass, seed_encrypt)) AS Decrypt_Seedtime

    FROM TestTable

    if i use seed_time as varchar it is returning exact value.. if i use int data type for seed_time it's giving some other value not the exact seed_time value.

    Please help me on this

  • i want to compare the encrypted_seed_time value with compare_date. How should i write the DATEDIFF with the encrypted_seed_time (when seed_time is in seconds).

    Below is the query where the seed_time is in seconds. and the query is working fine.

    I want if the seed_time value is encrypted how we have to compare encrypted seed_time value with the datediff..

    SELECT COUNT(prize_id)

    FROM iw.prizes_seeds

    WHERE prize_id = prz.prize_id

    AND seed_time BETWEEN DATEDIFF(ss,@compare_date,pp.start_date) AND DATEDIFF(ss,@compare_date,pp.end_date)

    )AS prize_count

    Please help me on this.

  • try using CAST insted of CONVERT,

    CAST(decryptbypassphrase(@pass, seed_encrypt) as int)

  • i tried with cast also.. but its not giving the same value..

    please help me on this

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply