<?xml version="1.0" encoding="utf-8"?>
<KScriptSetting>
  <Name>Security</Name>
  <Description>Private MD5 and SHA1 encryption and a simple two way encrypt and decrypt function</Description>
  <Example>
    <![CDATA[

<script engine="kscript"> 
    
    var input = "myvalue"; 
    var key = "hashkey"; 
    
    var md5value = k.security.md5(input); 
 
    var sha = k.security.sha1(input); 
  
    var encrptyValue = k.security.encrypt(input, key); 
    
    var decryptValue =k.security.decrypt(encrptyValue, key);  
      
</script>
 
	]]></Example>
  <Props />
  <Methods>
    <Method>
      <Name>md5</Name>
      <Description>Compute a 32 length text string value</Description>
      <Example> 
        <![CDATA[
 <script engine="kscript"> 
     var input = "myvalue";  
    var md5value = k.security.md5(input);  
</script>
	]]>
      </Example>
      <Params>
        <Param>
          <Name>Input</Name>
          <Description>The original value to compute MD5 value</Description>
          <Type>string</Type>
        </Param>
      </Params> 
    </Method>

    <Method>
      <Name>sha1</Name>
      <Description>Compute a 40 length text string value</Description>
      <Example>
        <![CDATA[
 <script engine="kscript"> 
     var input = "myvalue";  
     var shavalue = k.security.sha1(input); 
</script>
	]]>
      </Example>
      <Params>
        <Param>
          <Name>Input</Name>
          <Description>The original value to compute SHA1 value</Description>
          <Type>string</Type>
        </Param>
      </Params>
    </Method>


      <Method>
      <Name>encrypt</Name>
      <Description>Encrypt a string based on the key.</Description>
      <Example>
        <![CDATA[
 <script engine="kscript"> 
     var input = "myvalue"; 
     var key = "hashkey";  
     var encrptyValue = k.security.encrypt(input, key);  
    var decryptValue =k.security.decrypt(encrptyValue, key);  
</script>
	]]>
      </Example>
      <Params>
        <Param>
          <Name>Input</Name>
          <Description>The original value to compute encrypted value</Description>
          <Type>string</Type>
        </Param>

        <Param>
          <Name>key</Name>
          <Description>The key that can be used to encrypt and decrpte value.</Description>
          <Type>string</Type>
        </Param> 
      </Params>
    </Method>


    <Method>
      <Name>decrypt</Name>
      <Description>Encrypt a string based on the key.</Description>
      <Example>
        <![CDATA[
 <script engine="kscript"> 
     var input = "myvalue"; 
     var key = "hashkey";  
     var encrptyValue = k.security.encrypt(input, key);   
     var decryptValue =k.security.decrypt(encrptyValue, key);   
</script>
	]]>
      </Example>
      <Params>
        <Param>
          <Name>Value</Name>
          <Description>The encrpted value</Description>
          <Type>string</Type>
        </Param>

        <Param>
          <Name>key</Name>
          <Description>The key that can be used to encrypt and decrpte value.</Description>
          <Type>string</Type>
        </Param>
      </Params>
    </Method>
    
 
  </Methods>
</KScriptSetting>