Java based cipher queries