1. A method for encrypting a file, comprising: producing, using a processing device, an access rules string having embedded therein access rules to be imposed for restricting access to the file; generating, using the processing device, a public key derived from the access rules string; and encrypting, using the processing device, at least a portion of the file using the public key, such that the public key, in a form used to encrypt the portion of the file, contains the access rules string embedded therein and extractable therefrom when decrypting the portion of the file.