title: saving and encrypting java class
body: <p>I've written my own 3D Game Engine and started writing a game. I am using OBJ-Models that use the <a href="https://blog.turbosquid.com/royalty-free-license/" rel="nofollow noreferrer">TurboSquid Royalty Free License</a> </p>
  
  <p>Basically, it says that I can use their OBJ-Files but have to implement something that avoids the users to extract the OBJ-Files out of my program. 
  I've written a converter that extracts the information out of the OBJ-File and creates several float/integer arrays [vertices, vertexCoords, normals, tangents..., indices]</p>
  
  <p>These arrays will be used later for creating the VAOs / VBOs. So my idea was to create a Java class called <code>OBJModelData</code> that contains these arrays. <code>OBJModelData</code>implements <code>Serializable</code>. My attempt was to save the class into a file and use them instead of the OBJ-File so that the user cannot see and use the content.</p>
  
  <p>My attempt looks like this:</p>
  
  <pre><code>public void writeToFile(String file){
      File f = new File(OBJLoader.RES_LOC+ file +".dat");
      try {
          ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(f));
          out.writeObject(this);
          out.flush();
          out.close();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>This results in a file called <code>modelName.dat</code> and looks like this:
  <a href="https://i.stack.imgur.com/kyuck.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kyuck.png" alt="enter image description here"></a></p>
  
  <p>Obviously reverse engineering must be done the recreate my arrays. I just do not like the way its written. For example the class that has been serialized is written in the first line. If someone somehow manages the get the source files of my engine by doing some reverse engineering on that he could easily read the file.</p>
  
  <p>Is my method save enough to avoid recreating the obj files and can I still use this method to fulfill the license conditions or is there any other way that is normally used (e.g. in other games/engines) ?</p>