  We study non-associative twisted group algebras over $(\Z_2)^n$ with cubic
twisting functions. We construct a series of algebras that extend the classical
algebra of octonions in the same way as the Clifford algebras extend the
algebra of quaternions. We study their properties, give several equivalent
definitions and prove their uniqueness within some natural assumptions. We then
prove a simplicity criterion. We present two applications of the constructed
algebras and the developed technique. The first application is a simple
explicit formula for the following famous square identity:
$(a_1^2+...+a_{N}^2)\,(b_1^2+...+b_{\rho(N)}^2)= c_1^2+...+c_{N}^2$, where
$c_k$ are bilinear functions of the $a_i$ and $b_j$ and where $\rho(n)$ is the
Hurwitz-Radon function. The second application is the relation to Moufang loops
and, in particular, to the code loops. To illustrate this relation, we provide
an explicit coordinate formula for the factor set of the Parker loop.
