0
5
10
15
10
2
10
4
10
6
k
nanoseconds
Callee Caller Non-encrypted
Figure 5: Execution time of Algorithm 2 in nanoseconds.
The figure presents three graphs that correspond to three
execution modes: (1) the callee, i.e. the function f
k
, is en-
crypted (2) the caller is encrypted (3) neither the caller nor
the callee are encrypted.
varying number of parameters were called and the
call procedure was timed. The function contents were
identical: f
k
(int p
0
, ..., int p
k
) {p
0
∗ = p
0
;} As in the
previous study, each measurement was carried out
multiple times (400000) to reduce error, and a base-
Time was calculated to reflect the overhead associated
with managing the loop process, as shown in Algo-
rithm 2.
The baseTime was subtracted from the function
call measurements results. Three types of measure-
ments were conducted, each for all values of k: (a)
non-protected program, (b) protected caller which
calls an non-protected callee, (c) non-protected caller
which calls a protected callee. Figure 5 plots these
measurements on a logarithmic scale.
The largest overhead was acquired when the
callees were encrypted, since this operation is the
most involved: requiring preparation of the environ-
ment, transferring to the hypervisor, decrypting, inter-
preting in hypervisor and restoring the environment.
It is roughly 1.5 to 2 orders of magnitude greater as
compared to the case where only the caller was pro-
tected, since this has moderate overhead, only requir-
ing the hypervisor to prepare the environment and
transfer control to the agent.
The number of parameters generally increase the
timing linearly, as can be expected. However, when
comparing the two protected cases, it can be seen that
the gap between the results increases with the num-
ber of parameters. This indicates that the overhead of
preparing and restoring the environment is more sig-
nificant when the callee function is protected.
9 CONCLUSIONS
As has been shown, Java programs can be, at least par-
tially, protected from an adversary. We believe that
this degree of protection is sufficient in cases where
traditionally obfuscation was used. In other cases,
which require a higher degree of protection, we sug-
gest either avoiding using uninterpretable (by the hy-
pervisor) instructions or use a tool which can reduce
the frequency of uninterpretable instruction (by inlin-
ing methods, for instance).
While the performance penalty can be significant
(2-2.5 orders of magnitude) on frequent transitions
between the hypervisor and the JVM TI agent, the
performance improves when longer sequences of in-
structions can be interpreted in the hypervisor at once.
Obviously, sporadic execution of the protected parts
of a Java program has little effect on the overall per-
formance of the program.
REFERENCES
Algawi, A., Neittaanmaki, P., Zaidenberg, N. J., and Parisi-
nos, T. (2014). In kernel implementation of rsa rou-
tines. In ICCSM, pages 149–153.
Averbuch, A., Kiperberg, M., and Zaidenberg, N. J. (2011).
An efficient vm-based software protection. In Net-
work and System Security (NSS), 2011 5th Interna-
tional Conference on, pages 121–128.
Averbuch, A., Kiperberg, M., and Zaidenberg, N. J. (2013).
Truly-Protect: An Efficient VM-Based Software Pro-
tection. Systems Journal, IEEE, 7(3):455–466.
Binder, W. and Hulaas, J. (2006). Exact and portable pro-
filing for the jvm using bytecode instruction count-
ing. Electronic Notes in Theoretical Computer Sci-
ence, 164(3):45–64.
Bohne, L. (2008). Pandora’s Bochs: Automated Unpacking
of Malware. In Pandora’s Bochs: Automated Unpack-
ing of Malware.
Chander, A., Mitchell, J. C., and Shin, I. (2001). Mobile
code security by Java bytecode instrumentation. In
DARPA Information Survivability Conference &
Exposition II, 2001. DISCEX’01. Proceedings, vol-
ume 2, pages 27–40. IEEE.
Chubachi, Y., Shinagawa, T., and Kato, K. (2010).
Hypervisor-based Prevention of Persistent Rootkits.
In Proceedings of the 2010 ACM Symposium on Ap-
plied Computing, SAC ’10, pages 214–220, New
York, NY, USA. ACM.
Collberg, C., Myles, G., and Stepp, M. (2007). An Empir-
ical Study of Java Bytecode Programs. Softw. Pract.
Exper., 37(6):581–641.
England, P., Lampson, B., Manferdelli, J., Peinado, M., and
Willman, B. (2003). A Trusted Open Platform. Com-
puter, 36(7):55–62.
Harkema, M., Quartel, D., Gijsen, B., and van der Mei,
R. D. (2002). Performance monitoring of Java appli-
cations. In Proceedings of the 3rd international work-
shop on Software and performance, pages 114–127.
ACM.
System for Executing Encrypted Java Programs
251