Realizing AES in hardware faces increasingly more stringent demands for low cost as well as resisting power attacks. For security consideration, countermeasure power analysis approaches to mask sensitive data are needed. The algebraic masking method to protect AES against power attacks is based on various representations of underlying finite fields. However, implementing the transfer matrices between those fields requires a lot of memory spaces. In this paper, we propose a general method for sharing common subexpressions derived from the algebraic finite fields. Furthermore, we present a randomly configurable architecture for protecting SubByte transformation. Analytical results show that the proposed subexpression sharing method can significantly reduce up to 68.75% of memory requirement compared with individual implementations.