ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject Re: Ant tasks to encrypt or decrypt passwords from property files
Date Tue, 20 Jun 2006 13:13:49 GMT
Hello Alexey,

I have written something based on your code.
Actually, I wrote an ant task to create the key first.
I wanted to create filters (pluggable into filterchains) to encrypt and
decrypt, but I do not get that to work.
I might do an ant task to encrypt and a sort of loadproperties clone
which would take an encrypted file.
When I use filterchains and loadproperties, the decrypting does not
work, some of the bytes read by loadproperties (or the filterchain
framework) are not the same as the original.
Unfortunately, I am not litterate enough with streams, bytes, binary
operators and the like to know how to fix this. A shame, the solution
with filters would be elegant.



Alexey N. Solofnenko wrote:
> This can be done by requiring a key store in user home. Only people
> that have some special certificates, can encrypt/decrypt date (SSH
> style security). The decryption can be easily done with <scriptdef>.
> This is a corresponding Java code:
>        SecretKeySpec skeySpec=new SecretKeySpec(readAll("key"), "AES");
>        Cipher cipher=Cipher.getInstance("AES");
>        cipher.init(Cipher.DECRYPT_MODE, skeySpec);
>        String value=new String(cipher.doFinal(buffer), "UTF-8")
> It would be trivial to write a wrapper code for ANT. buffer has to be
> a byte array. I would suggest using binhex conversion.
> - Alexey.
> Dominique Devienne wrote:
>>> we would be interested in encrypting.
>> But then it's a chicken-and-egg problem, no?
>> Where are you going to store the passwords to decrypt the passwords
>> read from properties files? --DD
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message