code: def _jks_keystream(iv, password):
      
      cur = iv
      while 1:
          xhash = hashlib.sha1(bytes(password + cur)) # hashlib.sha1 in python 2.6 does not accept a bytearray argument
          cur = bytearray(xhash.digest()) # make sure we iterate over ints in both Py2 and Py3
          for byte in cur:
              yield byte
docs: Helper keystream generator for _jks_pkey_decrypt