[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subversion Wiki] Update of "MasterPassphrase" by CMichaelPilato

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 29 Mar 2012 17:24:14 +0200

Apache subversion Wiki wrote on Thu, Mar 29, 2012 at 14:07:49 -0000:
> + PREFIX_LEN=4
> +
> + def encrypt(PLAINTEXT, MP):
> + PREFIX = generate_random(PREFIX_LEN)
> + PREFIXED_PLAINTEXT_LEN = PREFIX_LEN + len(PLAINTEXT)
> + if PREFIXED_PLAINTEXT_LEN % 16:
> + PAD = NUL . generate_random(15 - PREFIXED_PLAINTEXT_LEN)

generate_random(15 - (PREFIXED_PLAINTEXT_LEN % 16))

> + else:
> + PAD = ''
> + SALT = generate_random(8)
> + IV = generate_random(16)
> + CIPHERTEXT = aes256cbc_encrypt(PREFIX . PLAINTEXT . PAD, IV, pbkdf2(MP, SALT))
> + return CIPHERTEXT, IV, SALT # these need to be stored
Received on 2012-03-29 17:25:00 CEST

This is an archived mail posted to the Subversion Dev mailing list.