Your PHP code can't execute on click. It can only be executed by server when you load the file, since you are waiting for user to input the password and then call the function it is not going to work.
Your javascript var pass is empty since you don't have POST at that point in time.
Flow that can work is:
execute PHP -> deliver html + javascript -> user input -> do crypt -> submit
So you can not rely on PHP to give you data in this case. You need to go with different approach here.
Try
<script>
function cript(){
var pass = CryptoJS.SHA1(document.getElementById('inputPassword').value);
var passString = pass.toString();
console.log(passString);
document.getElementById('inputPassword').value = passString;
}
</script>
This only takes care of problem related with trying to pass PHP
variable to javascript variable. Security issues about SHA1 are
another topic and if this is school project or fiddling around to
learn javascript then it is ok. This example for learning purposes how
to use javascript to access values in elements is ok. However if this
code is ever going to be put on server and be used, then SHA1 should
definitely be avoided