Abstract: A method and system for protecting native libraries for Java and other applications. An application's native library may be embedded in a system of code, such as Java code, so the protections afforded the system of code are provided to the native library. At runtime, the native library may be written to a randomly selected filename in a local file system. The native library is then loaded to support native method implementations. Because the library is written to a different and randomly chosen filename each time, a hacker will not know beforehand what library is going to be used. This invention is generally useful for protecting any native library, regardless of whether it is part of a shared Java library or not. It provides any native library the same level of protection that the symbolic obfuscator, or other method of protecting Java code, gives the Java code.