You can create PHP static such as JHtml in the ckpassword file.
Otherwise, better with JDom,
copy the cktext field, just add the parameters sent to JDom :
..
'modifiers' => array(
'type' => 'password'
)
...
Not tested, but should work. It is by memory. Let's see if it does not enter in conflict because 'type' is already defined. It might be outputed twice. To test.
... The power of JDom !!!
Other possibility, create a new JDom plugin, and call it from your field. (Take the example from textarea).
When you have done it, you can also PR on github your control