The invention belongs to the field of information safety and provides a role based
dynamic database desensitization service method and
system. The
system comprises a parser for
parsing SQL statements, a sensitive information setting unit for setting sensitive fields, desensitization functions and parameters for users of different roles, a sensitive
information storage unit for storing a
lookup table, a
data processing unit for generating the desensitization functions in a
database, obtaining user roles, verifying the integrity of the
lookup table and modifying SELECT statements according to the requirements in the
lookup table. In addition, the invention discloses the method, the method comprises the steps that the
SQL statements are parsed through the parser, if the
SQL statements are SELECT statements, the statements are submitted to the
data processing unit for
processing; if not, the statements are submitted to the
database. Different sensitive fields and desensitization functions are set for the users of different roles, different desensitization functions can be also set for the same sensitive fields, the requirement for different sensitive data protection degrees of the users of different roles are met, and the diversification demand during provision of data service is met.