On Fri, Jul 09, 2010 at 11:24:19AM -0500, Kavita Raghunathan scratched on the 
wall:
> Hello,
> I?m storing encrypted passwords in the sqlite database. The encryption
> algorithm generates ?null? character, and therefore the password
> strings can have nulls in them.
> 
>  1.  Is this an issue for storing in database ? If strcpy is used
>      anywhere, it would be a problem

  They can't be stored as text values without some type of encoding
  (like base64), but they can be stored as BLOBs.

>  2.  I?m using sprintf to generate the SQL statement as shown below.
>      This causes a problem because sprintf stops printing when it
>      encounters ?null?.

  Don't do that.  Use statement parameters and bind the data directly.
   
   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to