Add a Preparse field to the entry type you're posting to and make it generate a random string on entry save.
Then make the Guest Entries plugin redirect to a URL with that Preparse field's value in the query string.
<input type="hidden" name="redirect" value="success?id={id}&key={preparseField}">
You should now be able to get that entry model in your template and test against that Preparse field's value.
{% set query = craft.request.getQuery() %}
{% set entry = craft.entries.id(query.id).preparseField(query.preparseField).first() %}
{% if not entry %}
{% exit 404 %}
{% endif %}
{% set chars = '0123456789'|split('') %} {% set string = shuffle(chars)|join %} {{ string|slice(0, 5) }}and saved it as preparse field with handlesecterKey. On the front end everything is according to your answer in code except I changedkey={secretKey}and.preparseField(query.secretKey). I got error message that keysecretKeydoesn't exist. – Dominik Krulak Apr 02 '16 at 12:04...success?id=123&key=. I assume the string variable I set doesn't get passed to element model. Or I don't understand How it works. On plugin setting page both options are enabled. I think that doesn't effect it. – Dominik Krulak Apr 02 '16 at 12:08?id=422&key=097306but template got error with following message: Key "secretKey" for array with keys "p, id, key" does not exist. So I though I'm not accessing the actual string value but preparseField itself. So I ended up with(query.string)whereas it got passed through this error message but have encountered on another one. It can't access an attribute("attribute")on a string variable("422")which is ourentry.id. It seems to be a minor mistake – Dominik Krulak Apr 04 '16 at 19:48keystring (remain blank) on before entry save when a file is attached to form. I think it connects's to this issue. – Dominik Krulak Aug 24 '16 at 07:45