Cryptographic Symmetric Stream Cipher Let me know a cryptographic symmetric stream cipher system with only two functions say S() and P() and it should satisfy the following conditions:


There will be two independent computers say M1 and M2 (no connection exists between them) and only one function should be stored in a machine. 

For example: Function S() will be executed on machine "M1" and the function P() on machine "M2".
User selects a random string of bits (say X) of desired length (L) as input.
User selects a machine randomly (either M1 or M2) and executes the function with the selected random string X as input to it. For example: if machine *"M1"*is selected then the function S() will be executed to produce a output Y = S(X).
Then the user executes the other function P() with Y as input to produce the original random string X. 

For example: X = P(Y).
And again user repeats the process in reverse order using the same random string X as input. For example: the function P() in machine "M2" will be executed to produces a output Z = P(X).
And again the user executes the other function S() with Z as input to produce the original random string X. For example: X = S(Z).
Length of outputs Y and Z should be equal to the length of input X.
Outputs Y and Z should be non-linear with respect to the input X, and
Output of S(X) and P(X) should be different. For example: Y != Z.
Keeping it simple, it should demonstrate S(P(X)) = P(S(X)) = X. 

For example: function S and P are inverses of each other.


My questions:


How secure such a cipher?
I feel such functions output may be difficult for any known cryptanalysis, if not, why?
Is it easy/hard to design such a system?
Whenever you have two functions such that, for any X and any Y,
  X == S(P(X))
and also
  Y == P(S(Y)),
then
X and Y are bijective functions.

With modern secure communication systems, exactly the same plaintext message can be encrypted to many different ciphertext messages -- in particular, they are designed such that the message "attack" is unlikely to encrypt to the same ciphertext twice -- so therefore their "encryption" and "decryption" functions are not bijective.

Nevertheless, many classic ciphers are bijective, and often several of the parts inside a modern secure communication system are also bijective.

(The complete ciphertext message for a modern secure communication system typically begins with a random initialization vector or other nonce, has a "body" generated by some bijective function applied to the plaintext -- the particular bijective function is selected by a combination of the initialization vector and the encryption key -- and ends with a message authentication code.).

reciprocal ciphers

A cipher where P() and S() are not only bijective, but are the same function -- i.e., for any X, P(X) == S(X), and X == P(P(X)) -- is common, and known as a reciprocal cipher.

Some of the more famous reciprocal ciphers are:


The Enigma machine was a reciprocal cipher machine
ROT13
Beaufort cipher
Kama-sutra ciphers
XOR-based stream ciphers
One Time Pads (both XOR and Beaufort cipher versions)


Most mechanical cipher machines use a reciprocal cipher, so it wouldn't need a separate "encode mode" and "decode mode".

non-reciprocal bijective ciphers

Many classic ciphers are bijective, but not reciprocal: S(X) != P(X).

For example, the following ciphers are bijective but (usually) not reciprocal:


monoalphabetic substitution ciphers (except for Kama-sutra ciphers), and in particular the Caesar cipher (except for ROT13).
The standard Vigenère cipher, and the "variant Beaufort" cipher.
One Time Pads (the Vigenère cipher version)
transposition cipher (except for a few "paired-up" reciprocal transpositions)
permutation cipher


Practically all modern ciphers are based on either stream ciphers (RC4, A5/2, Solitaire cipher, etc.) or single-block ciphers (AES, DES, etc.), which are bijective but (almost always) not reciprocal.

Many modern single-block ciphers are built with a Feistel network structure that, in each round, cascades a reciprocal permutation E ("swap the left and right half of the block") and a keyed reciprocal substitution cipher U, to build a non-reciprocal bijective encryption function S(x) == E(U(X)) != P(X) = U(E(X).
It is widely believed that practically any non-linear function can give adequate security if it is iterated over enough rounds.

(Is it a coincidence that you used the names S() and P() that have the first letter of two common operations in cryptography, substitution and permutation, aka confusion and diffusion ?)

security

These bijective ciphers (both reciprocal and non-reciprocal) have a wide range of security, covering both ends of the spectrum:


Monoalphabetic substitution ciphers (aka cryptograms) published in newspapers as puzzles that are daily cracked by amateurs.
One-time pads which (in both reciprocal versions, and also the non-reciprocal version) are uncrackable.