All Projects → damianszczepanik → silencio

damianszczepanik / silencio

Licence: Apache-2.0 license
Silencio is a Java library for transforming and converting XML, JSON, YAML, Properties and other formats. It is applicable for most operations such as obfuscation, encryption, minimisation (minifying), anonymous. Library is fully customizable and extensible.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to silencio

Proguard Maven Plugin
ProGuard Maven plugin that supports modularised ProGuard packages
Stars: ✭ 353 (+1434.78%)
Mutual labels:  obfuscation, minification
Powershell-Obfuscator
Powerful script for logical obfuscation of powershell scripts
Stars: ✭ 27 (+17.39%)
Mutual labels:  obfuscation
TrezorSymmetricFileEncryption
🔒 Use your Trezor device to symmetrically encrypt and decrypt files
Stars: ✭ 16 (-30.43%)
Mutual labels:  obfuscation
react-obfuscate
An intelligent React component to obfuscate any contact link!
Stars: ✭ 87 (+278.26%)
Mutual labels:  obfuscation
code-obfuscation
一款iOS代码混淆工具(A code obfuscation tool for iOS.)
Stars: ✭ 32 (+39.13%)
Mutual labels:  obfuscation
nand nor
C++ Compile time NAND/NOR obfuscation
Stars: ✭ 32 (+39.13%)
Mutual labels:  obfuscation
kiteshield
Packer/Protector for x86-64 ELF binaries on Linux
Stars: ✭ 71 (+208.7%)
Mutual labels:  obfuscation
pdfminify
PDF minifier that allows removing duplicate data, re-compresses images, creation of PDF/A-1b and digital PDF signing
Stars: ✭ 46 (+100%)
Mutual labels:  minification
LLVM-Obfuscator
LLVM Obfuscator
Stars: ✭ 44 (+91.3%)
Mutual labels:  obfuscation
folm
Folm
Stars: ✭ 16 (-30.43%)
Mutual labels:  obfuscation
dumb-obfuscator
Tutorial on how to write the dumbest obfuscator I could think of.
Stars: ✭ 147 (+539.13%)
Mutual labels:  obfuscation
Jawbreaker
A Python obfuscator using HTTP Requests and Hastebin.
Stars: ✭ 50 (+117.39%)
Mutual labels:  obfuscation
chameleon
PowerShell Script Obfuscator
Stars: ✭ 319 (+1286.96%)
Mutual labels:  obfuscation
rollup-plugin-html
Import HTML files as strings in rollup build
Stars: ✭ 36 (+56.52%)
Mutual labels:  minification
MinifyAllCli
📦 A lightweight, simple and easy npm tool to 𝗺𝗶𝗻𝗶𝗳𝘆 JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as 𝑪𝑳𝑰 tool or 𝒊𝒎𝒑𝒐𝒓𝒕𝒂𝒃𝒍𝒆 in TS/JS as a 𝑴𝑶𝑫𝑼𝑳𝑬 🥰
Stars: ✭ 21 (-8.7%)
Mutual labels:  minification
baby obfuscator
Using LLVM Pass to obfuscate program
Stars: ✭ 66 (+186.96%)
Mutual labels:  obfuscation
Berserker
Obfuscate your Python scripts better, faster.
Stars: ✭ 81 (+252.17%)
Mutual labels:  obfuscation
VisualBasicObfuscator
Visual Basic Code universal Obfuscator intended to be used during penetration testing assignments.
Stars: ✭ 115 (+400%)
Mutual labels:  obfuscation
rusty-jsyc
JavaScript-To-Bytecode compiler written in Rust
Stars: ✭ 109 (+373.91%)
Mutual labels:  obfuscation
luasrcdiet
Compresses Lua source code by removing unnecessary characters (updated fork of http://luasrcdiet.luaforge.net/)
Stars: ✭ 60 (+160.87%)
Mutual labels:  minification

Github build AppVeyor Status

Coverage Status Sonarqube Status Codacy Codebeat Vulnerabilities

Maven Central License

silencio

Silencio is a Java library for transforming and converting formats such as

using well defined API. It is applicable for most of operations such as:

It is built from processors that manage transformations of the files (XML, JSON, Properties, etc.) decisions which decide which elements should be converted and converters that changes old value into new one.

Examples

Make it fast, write it simple

As presented in tests this is quite easy to convert the file:

   Reader input = new FileReader("myStructure.json");
   Writer output = new StringWriter();

   Processor processor = new Builder(Format.JSON).with(Builder.NUMBER_SEQUENCE).build();
   processor.load(input);
   processor.process();
   processor.write(output);

   System.out.println(output);

and as the result you may expect (depends of converter you selected) following output:

|   suv.json  -->>                         | < BlankConverter >            | < NumberSequenceConverter > | < YourConverter>  |
|==========================================|===============================|=============================|===================|
| {                                        | {                             | {                           |                   |
|  "model" : "SUV",                        |   "model" : "",               |   "model" : 1,              |                   |
|  "wheels" : 4,                           |   "wheels" : "",              |   "wheels" : 2,             |                   |
|  "size" : {                              |   "size" : {                  |   "size" : {                |                   |
|    "length" : 4.45,                      |     "length" : "",            |     "length" : 3,           |  create your      |
|    "height" : 2.05,                      |     "height" : "",            |     "height" : 4,           |                   |
|    "width" : 2.200                       |     "width" : ""              |     "width" : 5             |  own              |
|  },                                      |   },                          |   },                        |    converter      |
|  "weight" : {                            |   "weight" : {                |   "weight" : {              |                   |
|    "value" : 2.200,                      |     "value" : "",             |     "value" : 5,            | that's pretty     |
|    "unit" : "ton"                        |     "unit" : ""               |     "unit" : 6              |                   |
|  },                                      |   },                          |   },                        |                   |
|  "accessories" : [ "sunroof", "radio" ], |   "accessories" : [ "", "" ], |   "accessories" : [ 7, 8 ], |         easy!     |
|  "fuel" : [ {                            |   "fuel" : [ {                |   "fuel" : [ {              |                   |
|    "diesel" : true,                      |     "diesel" : "",            |     "diesel" : 9,           |                   |
|    "LPG" : true                          |     "LPG" : ""                |     "LPG" : 9               |                   |
|  } ],                                    |   } ],                        |   } ],                      |                   |
|  "notes" : null,                         |   "notes" : "",               |   "notes" : 0,              |                   |
|  "alarms" : { },                         |   "alarms" : { },             |   "alarms" : { },           |                   |
|  "assistance" : [ ]                      |   "assistance" : [ ]          |   "assistance" : [ ]        |                   |
| }                                        | }                             | }                           |                   |
|==========================================|===============================|=============================|===================|

Sky is the limit

So you know how it works but you want to decide which nodes should be transfered into what values. Imagine you are renting cars and your partner asked you to share all your specifications. Sounds good but you don't want to share prices (sensitive information). Also your database is a little bit outdated because all your cars already have sunroof even your services provide different information.

Take a look at example below. There are two iterations on the same file. First removes all values that match to given key money|cash|price. Second validates key (sunroot) and value (Optional) and transfers values into new one ([Standard]).

   Builder builder = new Builder(Format.PROPERTIES);
   builder.with(new MatcherDecision(".*(money|cash|price).*", null), Builder.BLANK)
          .with(new MatcherDecision(".*sunroof.*", ".*Optional.*"), new StringConverter("[Standard]"));
   Processor processor = builder.build();
   processor.load(input);
   processor.process();
   processor.write(output);

and the conversion will produce following outcome:

|   suv.properties  -->>         |   [ removing price ]           |   [ updated sunroof ]          |
|================================|================================|================================|
| model=SUV                      | model=SUV                      | model=SUV                      |
| price.value=38504              | price.value=                   | price.value=                   |
| price.currency=$               | price.currency=                | price.currency=                |
| wheels=4                       | wheels=4                       | wheels=4                       |
| size.length=4.45               | size.length=4.45               | size.length=4.45               |
| size.height=2.05               | size.height=2.05               | size.height=2.05               |
| size.width=2.200               | size.width=2.200               | size.width=2.200               |
| weight.value=2.200             | weight.value=2.200             | weight.value=2.200             |
| weight.unit=ton                | weight.unit=ton                | weight.unit=ton                |
| accessories.sunroof=[Optional] | accessories.sunroof=[Optional] | accessories.sunroof=[Standard] |
| accessories.radio=yes          | accessories.radio=yes          | accessories.radio=yes          |
| fuel.diesel=true               | fuel.diesel=true               | fuel.diesel=true               |
| fuel.LPG=true                  | fuel.LPG=true                  | fuel.LPG=true                  |
| notes=null                     | notes=null                     | notes=null                     |
| alarms=                        | alarms=                        | alarms=                        |
| assistance=                    | assistance=                    | assistance=                    |
|================================|================================|================================|

Usage

Add a maven dependency (using version from above shield) to your pom.xml or build.gradle:

<dependency>
    <groupId>pl.damianszczepanik</groupId>
    <artifactId>silencio</artifactId>
    <version>2.0.0</version> <!-- check above shield to confirm last release -->
</dependency>

The simplest way to understand how to use processor with set of converters is to check tests that validate this implementation.

Create custom processor, converter or format

Both processors and converters can be extended. They are like plugins: you can add your own implementation as long as you keep the contract. There are several built-in converters that can be easily accessed via builder. Nevertheless if you need to create your own just implement convert() method and provide the algorithm you expect. Sometimes rules might be very simple.

Silencio supports most of the popular data formats but it is possible to write support for new one. It is not difficult when using external library that allows to manipulate such format. For more reference check pull that introduced support for XML.

Code quality, test coverage

Once you developed your new processor or converter you should test it by providing several unit tests and by passing it to processor checker that makes basic tests using edge cases.

codecov.io

Contribution

When you implement new processor or converter you are more than welcome to pull this change and make someone happier!

Mind that this project has several metrics that measure code quality. From continuous integration and code coverage to coverity and checkstyle. All PRs are welcome but try to keep high code coverage and good documentation of the code you deliver.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].