  The recent line of study on randomness extractors has been a great success,
resulting in exciting new techniques, new connections, and breakthroughs to
long standing open problems in several seemingly different topics. These
include seeded non-malleable extractors, privacy amplification protocols with
an active adversary, independent source extractors (and explicit Ramsey
graphs), and non-malleable codes in the split state model. However, in all
cases there is still a gap to optimum and the motivation to close this gap
remains strong.
  In this paper, we introduce a set of new techniques to further push the
frontier in the above questions. Our techniques lead to improvements in all of
the above questions, and in several cases partially optimal constructions.
Specifically, we obtain: 1. A seeded non-malleable extractor with seed length
$O(log n)+log^{1+o(1)}(1/\epsilon) and entropy requirement O(log log
n+log(1/\epsilon)), where the entropy requirement is asymptotically optimal by
a recent result of Gur and Shinkar \cite{GurS17}; 2. A two-round privacy
amplification protocol with optimal entropy loss for security parameter up to
\Omega(k), which solves the privacy amplification problem completely; 3. A
two-source extractor for entropy O(\frac{log n log log n}{log log log n}),
which also gives an explicit Ramsey graph on N vertices with no clique or
independent set of size (log N)^{O(\frac{log log log N}{log log log log N})};
and 4. The first explicit non-malleable code in the 2-split state model with
\emph{constant} rate, which has been a major goal in the study of non-malleable
codes for quite some time. One small caveat is that the error of this code is
only (an arbitrarily small) constant, but we can also achieve negligible error
with rate \Omega(log log log n/log log n), which already improves the rate in
\cite{Li17} exponentially.
