As embedded systems are being used in a wide variety of critical applications, providing security to data stored and processed in these systems has become an important issue. However, providing security incurs performance and power overheads that need to be limited in resource-constrained embedded environments. Consequently, architectural support to limit these overheads to be incurred only while storing or processing vital data is desirable. In this paper, we present an architecture that provides selective encryption protection for storage and processing protection to power analysis attacks for data marked as requiring security. Further, we show how the code can be transformed to reduce the overhead associated with protecting secure data.