Is there a way to encrypt/lock a File.CreateText file? (its my highscore)

So my high score system is a little weird. I use the File.CreateText thing to do it, here is the script if you need it: (Java and its called ScoreSave)
import System.IO;

var fileName = "";
var ScoreAmount : int;

var HighScore : int;

function Start (){
    HighScore = ScoreLoad.CompareScore;
    ScoreAmount = GlobalScore.CurrentScore;
    if (ScoreAmount >= HighScore){
        var OurFile = File.CreateText(fileName);
        OurFile.WriteLine (ScoreAmount);

Also here is my script for loading the score if that is needed for explanation (java and its called ScoreLoad):

import System.IO;

var fileName = "";
var ScoreLoad : String;
var HighScoreDisplay : GameObject;

var line : String;

static var CompareScore : int;

function Start(){
    var sr : StreamReader = new StreamReader(fileName);

    line = sr.ReadLine();
    while (line != null){
        ScoreLoad = line;
        line = sr.ReadLine();


    HighScoreDisplay.GetComponent.<Text>().text = "" + ScoreLoad;

    CompareScore = int.Parse(ScoreLoad);

My question is how do I make it so in the final build, players wont just be able to go to the game files, go into the file called and change their high score to a high number aka cheat? How do I like encrypt it or lock it or make it permanently read only or something? Anything helps, thank you!
Also it needs to be able to save the highscore when it gets a new one so would read only not work? Help please. Thanks.

encriptions and keys is a very big question. i guess it would simply depend on the security you need. I wrote a simple encryption for you. its not as secure as some advanced techniques or preshared keys but this should be enough to prevent users from editing or even knowing what they are looking at.

this script i wrote for you changes numbers into letters based on your key.

also it adds two additional numbers for every one number. the new set of three numbers must all add together properly so a user can’t just change any one character or two characters in the encrypted string or you know its been tampered with. Additionally with this script you could incorporate the user’s name into the key so people couldn’t share files. just make sure every letter in the key is unique.

public var score:int;
	public var output:String;
	 var key:String;
	var err:boolean;
	function Start(){
		//key represents numbers 0 through 9;
		key = "qwertyuiop";

		// example number
		print ("original:" + score);

		output=scramble (score);
		print ("scrambled number: " + output);
		print ("returned:"+unscramble (output));

	 function scramble(sint:int):String{
		var i:int;
		var i2:int;
		var i3:int;

		var s1:String="";
		var s2:String="";
		s1 = sint.ToString();

		i = s1.Length;
		while (i>0) {i--;
		return s2;

	// change number into letter
	function keyed(i:int):String{
		return key.Substring (i, 1);}

	//change letter into number
	function unkey(s:String):int {
		var i2:int=-1;
		var i:int = key.Length;
		while (i>0) {i--;
		if(i2==-1){err=true;return 0;}else{return i2;}

	function unscramble(s:String):int{
		var i: int;
		var i2: int;
		var i3: int;
		var i4: int;

		var s2:String ="";
		err = false;
				i = s.Length;
				while (i>0) {i=i-3;
		if(err){return 0;print ("tampered numbers");}
				return i;}