Encrypting algorithm I know there are some encrypting algorithm that once the text (the message) is encrypted there is no way to decrypt it.
I can think one way of doing this: using as encryption key the current date at the encryption moment. But there is one problem wiht that: Each time you encrypt the same message the result will be different.
I think there must be some "math-algorithm" to encrypt without out the posibility to decrypt and that always the same message turns out with the same encrypted message, but I realy can't imagine how to do it.
Note: I'm posting this question in this forum and not in stackoverflow.com intentionally, it is not referred to "how to programm the algorithm", it is refered to "how is the math algorithm".
 A: Such algorithms do exist. Which one you mean depends on what you mean by "no way to decrypt it". You refer to either:


*

*A function which takes an input and generates a unique output, with there being ideally no known way to derive the input from the output. These are called hashing algorithms; examples of which include MD5, SHA256. Those links provide more detail than I possibly can.

*A cryptosystem that is impossible for any other person but the keyholder to decrypt. This is the one time pad J.M. mentions. This is the only currently proven-secure algorithm.



Edited in because this is probably too long for comments:
Diego, no problem. They're not, as they're two different things and you're comparing apples and oranges, so to speak. A cryptosystem is designed to be hard to undo without the key, but easy if you have the key. By contrast, a hashing function should only require 1 input, be one way and give a unique output for each input. The idea is to be able to generate a unique representation of the output without being able to deduce what the output is. Why?
Well aside from verifying the unique nature of your input, a hashing function is used as part of a digital signature. In a public key cryptosystem, you may well be aware that Alice can send Bob an encrypted message using Bob's public key. However, anyone can send Bob a message using Bob's public key. If Eve has broken the cryptosystem, she could intercept Alice's message, decrypt it, change it, re-encrypt it and send it on to Bob.
How do we prevent this? Well, let $H: x\rightarrow y$ be a map from $x$ some input to $y$ some output. It is trivial to compute $H$ but impossible (ideally, the truth is just very very unlikely) to compute $H^{-1}$. 
Then let $C:x,k$ be some assymetric cryptosystem Alice and Bob know, with Alice's keys $a_p$ and $a_s$ (public and secret) and likewise Bob's keys $b_p$ and $b_s$.
Now we know that as this cryptosystem is assymetric, that $C:x,b_p \rightarrow z$ where $z$ is some ciphertext (encrypted secret) and that $C:z,b_s \rightarrow x$ i.e. if you use Bob's public key to encrypt, Bob's private key using exactly the same algorithm will decrypt the process.
This we know already. However, as discussed, a man in the middle attack is possible if Eve knows Bob's secret. However, Alice can do two things:


*

*Compute $C(H(x), a_s)$

*Compute $C(x+H(x), b_p)$


And send the second one to Bob. What's the point in this? Well, Bob can reverse both "encryptions", because he holds the opposite keys (his own private and Alice's public. He is left with two things: the ciphertext and a unique hash of the ciphertext. He can also compute H(x) and compare results. If they differ, he knows the message has been tampered with.
Why? Well, consider Eve sat gleefully with Bob's keys. She intercept's Alices message and sees it contains the two parts (she can decrypt the outer layer, Bob's message). However, now she's left with an impossible situation. She can compute the hash of her newly inserted message, but she does not know Alice's private key (if she does, the cryptosystem is truly broken). Therefore she cannot encrypt the new hash. So, if she tries to send the new message onwards, Bob will immediately be aware the system has been tampered with.
This is called a digital signature or digitally signing and is used to identify the message author as who they truly say they are. After all, only they can encrypt with their private key (allegedly). The importance of hashing in this scenario is that it generates a unique output for each given output. However, not being reversible is also desired so that it is impossible to determine what a secret is given the output. This also makes it a highly used password-storage mechanism (because in theory, you're not storing the passwords, just a unique representation of them).
As always in cryptography, someone is always trying to break hash functions. Rainbow tables are the technique used to pre-compute parts of hashes to make hash reversing easier. Note however that the longer the input, the larger the tables need to be. Hence why passwords should always be greater than 6 characters...
Finally, you may be interested to know in Hash weaknesses. If two hashes with unique input produce the same output, this is called a collision and is a serious weakness, especially if someone can work out any pattern to said collisions. MD5 is thought to suffer from some, as is SHA1. SHA2 may, also. In any case, NIST has launched SHA-3, a competition to find future hash functions offering security now and in many years to come. The finalists are available to view here.
A: As J.M. commented above, the only totally secure cryptographic algorithm is the one-time pad. Because this relies on both the sender and receiver of a message to be able to have access to the same arbitrarily long random sequence, it is often not feasible. Cryptography originally relied on shared keys, from which simple ciphers, such as Vigenere, Caesar, and substitution, come from. Unfortunately, all of these algorithms are so simple that using frequency analysis can often be used to break them very quickly. 
Modern cryptography is generally split into two core areas: symmetric and asymmetric algorithms. Symmetric seems to be what you are describing, so I will describe that first. In symmetric algorithms, both users must share a key, which they often pass to one another via asymmetric cryptography or using Diffie-Hellman key exchange. Once the key is known between the two parties, eavesdroppers are generally going to have a very difficult time breaking the encryption. As with all things, certain algorithms are stronger than others. Older encryption schemes like DES are not as secure as some of the newer ones like AES, and it's not infeasible to try to break the weaker ones with sufficient computing power. Asymmetric cryptography, or public key cryptography, eliminates the need to share keys between users by admitting a public key and private key for each user. To send something to someone else, you encrypt using their public key (which they publish) and only they are able to decrypt using their private key. RSA and ECC are two of the more common public key protocols.
A: I can give an answer, which may seem like a joke. But you can map all text (the set of all codes) to the same result. 
Say for example I map the codes 
ABC to 1
BDCD to 1 
ABDGR to 1
there is no opportunity for decoding here. :)
