Cannot use IV in ECB mode. It is kind of controversial, however, as it should
Never use ECB mode for Anything, Ever *.
In more general terms, you probably shouldn't use crypto primitives directly, but rather use a cryptographic library, such as keyczar , that contains theses of these solutions.
** Actually, there is a very specialized use for ECB, such as “safe” pseudo-random permutations, but you certainly should not use ECB for anything related to data encryption.
source share