  This paper studies an information-theoretic one-shot variable-length secret
key agreement problem with public discussion. Let $X$ and $Y$ be jointly
distributed random variables, each taking values in some measurable space.
Alice and Bob observe $X$ and $Y$ respectively, can communicate interactively
through a public noiseless channel, and want to agree on a key length and a key
that is approximately uniformly distributed over all bit sequences with the
agreed key length. The public discussion is observed by an eavesdropper, Eve.
The key should be approximately independent of the public discussion,
conditional on the key length. We show that the optimal expected key length is
close to the mutual information $I(X;Y)$ within a logarithmic gap. Moreover, an
upper bound and a lower bound on the optimal expected key length can be written
down in terms of $I(X;Y)$ only. This means that the optimal one-shot
performance is always within a small gap of the optimal asymptotic performance
regardless of the distribution of the pair $(X,Y)$. This one-shot result may
find applications in situations where the components of an i.i.d. pair source
$(X^{n},Y^{n})$ are observed sequentially and the key is output bit by bit with
small delay, or in situations where the random source is not an i.i.d. or
ergodic process.
