Sebastian Andrzej Siewior wrote: > Don't use this as a block cipher in dm-crypt, it is a bad idea. > > The long story: > ARC4 is a stream cipher and not a block cipher. Its internal state is > reseted in setkey() and every crypto request (encrypt/decrypt don't > matter) update the internal state of the stream cipher. That's why you > get a different result every time you read the same block. > > If you want to use this stream cipher in dm-crypt you would have to > setup it up in ECB mode and use a key like "passphrase-IV". You have to > set this key before a requests and wait until its done until you > issue another crypto request (which includes setkey). yes, I understand why this happens. I do not want to use stream cipher, but apparently users will do that:-) My question was why crypto allows this setting? Or maybe what to do in dm-crypt to not allow user set such cipher mapping (because it cannot produce anything useful). IMHO it will not work even in ECB mode here for dm-crypt. (also dm-crypt uses own IV function generators, but it is another story) > CBC will not work because one of its requirements is that the cipher > provides an inverse function which ARC4 simply does not have. Again, why crypto API allows to use it and do not produce error then? Milan -- mbroz@xxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html