Better than diceware? And sha512 related question I am working on a secure password generator based on the following setup:


choose a publicly know (text) file
make some deliberate memorable changes to it
use collected entropy for a secure password ???


Details:


The text file can be anything provided it has a reasonable character count.
For example: pick a book with $2^{20}$ characters ≈  550 pages of human readable text
Changing/inserting *) a character within this text from the base64 alphabet yields an estimated entropy of: 20 + 6 + 1 = 27bits  correct ???


20bits = from the positions within the text

6bits = from the changed character (this is slightly less since the character that is to be changed can not be used from the base64 alphabet, but we can add an additional special character to base64 to overcome this)

1bit accounts for insertion or change of a character

*) any modifications to the text add different additional entropy: deleting passages, copying passages to different location, reversing passages, deleting pages etc,…

This yields more than twice the bits of diceware entropy (≈ 13bits)

3) Repeat step 2 to accumulate desired level of entropy in an other location of the file. Thus one could accumulate 135bits of entropy with only 5 modifications!?

4) Use this entropy to generate the password but how???

PROBLEM:
I find using a simple sha512 on the modified text file and using the output as password might endanger the setup since:

The idea is to make the unmodified text file public and the adversary would then know  $2^{20}$ - 5 = 1048571 characters (that’s almost 100%)  that were not changed.

Is the below solution viable???

1) Transfer the text file into a $2^{10}$  characters by $2^{10}$ + x  matrix
(x is for padding, since the original length of the text file of $2^{20}$  characters  might have increased if the user inserted some characters as part of his/her modification)

2) Hash with sha512: line by line to create an other $2^{9}$ bit by $2^{10}$ + x  matrix

3) Hash the resulting matrix with sha512: column by column to create the final $2^{9}$ by $2^{9}$  matrix

4) finally xor the resulting matrix line by line to receive the $2^{9}$ bit password

Would this withstand the issue with the adversary knowing  $2^{20}$ - 5 = 1048571 characters?

thanx
I don't really see the problem with just hashing the modified text. Even when the original text is public information, you've already shown that introducing $n$ independent changes gives you $\approx27n$ bits of entropy. Hence given an output hash, finding the modified text should be as difficult as exhaustive search if the hash function has pre-image resistance (and collision resistance, to ensure that the hashes of your modified text “look random“ conditioned on your original text).

Anyway, your line-by-line construction looks to me equivalent to some other hash function which combines multiple SHA512 invocations, so I can't imagine it'd be any more secure. Why don't you simply make a diff (e.g. insert a at position 12381, change position 812931 to f) and hash the result?