anonimatron icon indicating copy to clipboard operation
anonimatron copied to clipboard

Only String data types supported?

Open nmiller12 opened this issue 9 years ago • 6 comments

Hi, the anonimatron is great. I have noticed that it will only work on string database types. Is that correct?

For example the readme uses the RANDOMDIGITS anonymizer for the Credit Card field. However the database field is a varchar, rather than integer etc.

I believe that to convert integer field types I would need to create a new Synonym to use other than StringSynonym. Is that correct? Though I'm not sure how easy it would be to get a non-string Synonym to write/read to the synonym XML file.

nmiller12 avatar May 09 '16 03:05 nmiller12

Hi,

Glad you like it. Anonimatron should give you the data as the jdbc driver got it from the database. The best example I could find right now is the date anonimyzer:

https://github.com/realrolfje/anonimatron/blob/master/src/main/java/com/rolfje/anonimatron/anonymizer/DateAnonymizer.java

The input/output of a synonym is base64 encoded, so the data is well preserved and can be any object.

If you like I can help you write a number anonimyzer next week, that would be fun and a good example.

Can you give it a try and send me what you've got? If not I'll try next week and let you know.

Cheers, Rolf

Op 8 mei 2016 om 23:33 heeft nmiller12 [email protected] het volgende geschreven:

Hi, the anonimatron is great. I have noticed that it will only work on string database types. Is that correct?

For example the readme uses the RANDOMDIGITS anonymizer for the Credit Card field. However the database field is a varchar, rather than integer etc.

I believe that to convert integer field types I would need to create a new Synonym to use other than StringSynonym. Is that correct? Though I'm not sure how easy it would be to get a non-string Synonym to write/read to the synonym XML file.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

realrolfje avatar May 09 '16 12:05 realrolfje

Hi,

I have made a Number Anonymizer and a Timestamp Anonymizer. The Number Anonymizer I created for use on integer database fields, such as int, boolean. I created a IntegerSynonym to use to set an Integer value. The Timestamp Anonymizer uses a TimestampSynonym that sets a java.sql.Timestamp. They do not currently export as base64 in the synonym file yet.

Not sure if this is the expected way to go about it, but it seems to work ok. I have tested with postgres and mysql. And using java 1.6, with anonimatron 1.8.1 (I note that the 1.8.2 requires java7 which I am unable to use because our servers are stuck on java1.6 unfortunately)

Nick

From: realrolfje <[email protected]mailto:[email protected]> Reply-To: realrolfje/anonimatron <[email protected]mailto:[email protected]> Date: Monday, 9 May 2016 10:40 pm To: realrolfje/anonimatron <[email protected]mailto:[email protected]> Cc: Nick <[email protected]mailto:[email protected]>, Author <[email protected]mailto:[email protected]> Subject: Re: [realrolfje/anonimatron] Only String data types supported? (#2)

Hi,

Glad you like it. Anonimatron should give you the data as the jdbc driver got it from the database. The best example I could find right now is the date anonimyzer:

https://github.com/realrolfje/anonimatron/blob/master/src/main/java/com/rolfje/anonimatron/anonymizer/DateAnonymizer.java

The input/output of a synonym is base64 encoded, so the data is well preserved and can be any object.

If you like I can help you write a number anonimyzer next week, that would be fun and a good example.

Can you give it a try and send me what you've got? If not I'll try next week and let you know.

Cheers, Rolf

Op 8 mei 2016 om 23:33 heeft nmiller12 <[email protected]mailto:[email protected]> het volgende geschreven:

Hi, the anonimatron is great. I have noticed that it will only work on string database types. Is that correct?

For example the readme uses the RANDOMDIGITS anonymizer for the Credit Card field. However the database field is a varchar, rather than integer etc.

I believe that to convert integer field types I would need to create a new Synonym to use other than StringSynonym. Is that correct? Though I'm not sure how easy it would be to get a non-string Synonym to write/read to the synonym XML file.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/realrolfje/anonimatron/issues/2#issuecomment-217853189

nmiller12 avatar May 10 '16 01:05 nmiller12

I created a fork and commited the above files here: https://github.com/nmiller12/anonimatron/commit/0d22c05cd9a697c3bb5613e71901bee51bdc4ef7

nmiller12 avatar May 10 '16 02:05 nmiller12

Great thanks, I'll have a look and also will see if I can make it work on 1.6 again.

Op 9 mei 2016 om 22:16 heeft nmiller12 [email protected] het volgende geschreven:

I created a fork and commited the above files here: nmiller12@0d22c05

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

realrolfje avatar May 10 '16 11:05 realrolfje

Looks like this feature/fix is not merged, I would like to use this .

subeeshes avatar May 16 '21 03:05 subeeshes