  The linear complexity and k-error linear complexity of a sequence have been
used as important measures of keystream strength, hence designing a sequence
with high linear complexity and $k$-error linear complexity is a popular
research topic in cryptography. In this paper, the concept of stable $k$-error
linear complexity is proposed to study sequences with stable and large
$k$-error linear complexity. In order to study k-error linear complexity of
binary sequences with period $2^n$, a new tool called cube theory is developed.
By using the cube theory, one can easily construct sequences with the maximum
stable $k$-error linear complexity. For such purpose, we first prove that a
binary sequence with period $2^n$ can be decomposed into some disjoint cubes
and further give a general decomposition approach. Second, it is proved that
the maximum $k$-error linear complexity is $2^n-(2^l-1)$ over all
$2^n$-periodic binary sequences, where $2^{l-1}\le k<2^{l}$. Thirdly, a
characterization is presented about the $t$th ($t>1$) decrease in the $k$-error
linear complexity for a $2^n$-periodic binary sequence $s$ and this is a
continuation of Kurosawa et al. recent work for the first decrease of k-error
linear complexity. Finally, A counting formula for $m$-cubes with the same
linear complexity is derived, which is equivalent to the counting formula for
$k$-error vectors. The counting formula of $2^n$-periodic binary sequences
which can be decomposed into more than one cube is also investigated, which
extends an important result by Etzion et al..
