{"id":21476899,"url":"https://github.com/allurx/blur","last_synced_at":"2026-01-09T23:06:55.903Z","repository":{"id":45797382,"uuid":"200665532","full_name":"allurx/blur","owner":"allurx","description":"Blur is a Java library for masking and obfuscating sensitive data in any data structure","archived":false,"fork":false,"pushed_at":"2024-11-08T04:39:40.000Z","size":453,"stargazers_count":143,"open_issues_count":0,"forks_count":55,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-14T14:52:18.985Z","etag":null,"topics":["annotatedtype","based-on-java-reflection","desensitization","jdk21","sensitive-data"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allurx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-08-05T13:54:47.000Z","updated_at":"2025-08-13T11:20:34.000Z","dependencies_parsed_at":"2022-07-17T01:16:02.935Z","dependency_job_id":"77d09a5a-af91-453b-a37b-a1745b549b6f","html_url":"https://github.com/allurx/blur","commit_stats":null,"previous_names":["allurx/desensitization"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/allurx/blur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allurx%2Fblur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allurx%2Fblur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allurx%2Fblur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allurx%2Fblur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allurx","download_url":"https://codeload.github.com/allurx/blur/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allurx%2Fblur/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271500361,"owners_count":24770375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotatedtype","based-on-java-reflection","desensitization","jdk21","sensitive-data"],"created_at":"2024-11-23T11:10:52.612Z","updated_at":"2026-01-09T23:06:55.857Z","avatar_url":"https://github.com/allurx.png","language":"Java","readme":"# Blur\n\nBlur is a Java library for masking and obfuscating sensitive data in any data structure. \nIt is designed to be flexible and easy to use, and supports the following types of data blurring:\n\n* **String**\n* **Name**\n* **Password**\n* **Email Address**\n* **Phone Number**\n* **ID Card Number**\n* **Bank Card Number**\n* **Cascading Blurring**\n* **Custom Annotation-Based Blurring**\n\n# Usage\n\n## JDK Version\n\nBlur is built on JDK 21. For projects using JDK 1.8 or later, please refer to this [user guide](https://github.com/allurx/blur/tree/v2.4.6).\n\n## Maven Dependency\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.allurx\u003c/groupId\u003e\n    \u003cartifactId\u003eblur\u003c/artifactId\u003e\n    \u003cversion\u003e${latest version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Example\n\n### Object Field Blurring\n\nBelow is an example of a `Person` class containing some sensitive data fields and nested sensitive data fields.\n\n```java\npublic class Person {\n\n    @Name\n    public String name = \"allurx\";\n\n    @PhoneNumber\n    public String phoneNumber = \"19962000001\";\n\n    @Password\n    public String password = \"123456789\";\n\n    @Cascade\n    public Father father;    \n\n}\n```\nSimply annotate the sensitive data fields with the appropriate annotations like `@Name`, `@PhoneNumber`, `@Password`, etc. \nIf the field contains an object that requires cascading blurring, mark it with the `@Cascade` annotation. \nFinally, to obfuscate all the sensitive information within the object and return a new instance, use the following:\n\n```java\nvar person = Blur.blur(new Person());\n```\n\n### Value Blurring\n\nBlurring sensitive data in `String`, `Collection`, `Array`, or `Map` types is just as simple and easy.\n\n```java\nvoid blur() {\n\n    // String\n    var v1 = Blur.blur(\"123456@qq.com\", new AnnotatedTypeToken\u003c@Email String\u003e() {\n    });\n    assertEquals(\"1*****@qq.com\", v1);\n\n    // Collection\n    var v2 = Blur.blur(Stream.of(\"123456@qq.com\").collect(Collectors.toList()), new AnnotatedTypeToken\u003cList\u003c@Email String\u003e\u003e() {\n    });\n    v2.forEach(s -\u003e assertEquals(\"1*****@qq.com\", s));\n\n    // Array\n    var v3 = Blur.blur(new String[]{\"123456@qq.com\"}, new AnnotatedTypeToken\u003c@Email String[]\u003e() {\n    });\n    Arrays.stream(v3).forEach(s -\u003e assertEquals(\"1*****@qq.com\", s));\n\n    // Map\n    var v4 = Blur.blur(Stream.of(\"allurx\").collect(Collectors.toMap(s -\u003e s, s -\u003e \"123456@qq.com\")), new AnnotatedTypeToken\u003cMap\u003c@Name String, @Email String\u003e\u003e() {\n    });\n    v4.forEach((s1, s2) -\u003e {\n        assertEquals(\"a*****\", s1);\n        assertEquals(\"1*****@qq.com\", s2);\n    });\n}\n```\nIn this example, constructing the `AnnotatedTypeToken` for the blurred objects is necessary to accurately capture the actual type of the object being blurred along with the appropriate annotations.\n\n# How It Works\n\nBlur uses [annotation-parser](https://github.com/allurx/annotation-parser) to parse custom blurring annotations across any data structure. \nFor more details, you can refer to the project documentation.\n\n# Extension\n\nIf your application is built on Spring Boot and you prefer not to manually call blurring methods in your code, \nthe [blur-spring-boot](https://github.com/allurx/blur-spring-boot) library can be very helpful. You can find more information in the project documentation.\n\n# License\n\n[Apache License 2.0](https://github.com/allurx/blur/blob/master/LICENSE.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallurx%2Fblur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallurx%2Fblur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallurx%2Fblur/lists"}