terça-feira, 28 de janeiro de 2020

Java Obfuscate Properties

Hi there how many times we have fuckin stupid commentaries of , hey the code has a password... bullshit you can always get the password... Ok lets encrypt, obfuscate , anything In last days i just get an example of very well writen lib "refcodes-configuration-ext-obfuscation" that can read / save a java properties file, and can read / write encripted data. An example: Let's save a property to an file:

package org.ofusc.prop;

import org.refcodes.configuration.PropertiesSugar;
import org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder;
import org.refcodes.configuration.ext.obfuscation.ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder;
import org.refcodes.configuration.ext.obfuscation.ObfuscationResourcePropertiesBuilderDecorator;

public class testPropOfusc {

 public static void main(String[] args) {

  try {
   new testPropOfusc().run();
  } catch (Exception e) {
   e.printStackTrace();
  }

 }

 private void run() throws Exception {

  ResourcePropertiesBuilder properties = PropertiesSugar.seekFromJavaProperties(
    "test.properties");

  String theSecret = "1234567890";
  properties.put("secret", "encrypt:" + theSecret);

 }
}

Let 's see the props file:

secret=decrypt\:jNckuOrrv/IYLQ\=\=


cool it saved some shit that is encripted somehow. Letś read it now:

  ResourcePropertiesBuilder properties = PropertiesSugar.seekFromJavaProperties(
    "test.properties");

  ObfuscationResourcePropertiesBuilder theObfuscated = new ObfuscationResourcePropertiesBuilderDecorator(
    properties);
  String theValue = theObfuscated.get("secret");
  System.out.println(theValue);
Cool, it worked... Dont forget the mvn repo on pom.xml

    org.refcodes
    refcodes-configuration-ext-obfuscation
    2.0.0


bye,

quinta-feira, 9 de janeiro de 2020

Ubuntu 16, suspend with HDMI turn off sound

oh, my god after some crazy months, i finally discovered why ubuntu after a suspend, the sound did stop working
vi /etc/modprobe.d/alsa-base.conf
# add 
"options snd-hda-intel probe_mask=1"

# shiftzz

sudo reboot
and thats is why ? dont know... credits from https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1826868/comments/3

Java Obfuscate Properties

Hi there how many times we have fuckin stupid commentaries of , hey the code has a password... bullshit you can always get the password... ...