Apparatus and method for secure data processing