Can the encrypted string contain only alphabets?

Hi friends,
I have problem with the encryption. I am using Des .
I want to get the encrypted string which contains only alphabets ( no digits or no special characters).
Help appreciated.
Thanks.

Within the Java Cryptographic Extension (JCE), encryption works on bytes and generates bytes. You can convert any arbitrary String to bytes using one of the String.getBytes() methods (preferably the one where you define the encoding to use). The way you restrict what the plane text String contains is up to you.
The JCE produces secure encryption based on well tested algorithms.
The tone of your question implies that all you want to do is have a simple substitution cipher. The is very VERY VERY insecure and can be broken by a 2 year old. Use the JCE.

Similar Messages

  • Validation Rule - Should contain only alphabets and can be upto 4 characters long

    Hi, I am using MDS 2012 and want to create a business rule for data validation which says,
    "Should contain only alphabets and can be up to 4 characters long". How can I create such a rule in MDS? Also the Code and Name attributes are 250 characters by default. How to restrict them to 4 characters if business need them to be 4 or
    less character?
    Any help appreciated.
    Thanks, Ashish Singh

    When creating a business rule, under Actions there is "Must be maximum length of" and "must contain patern".
    See:
    http://technet.microsoft.com/en-us/library/ff487015.aspx

  • Can the composition widget container be rotated?

    I designed a background image with a 2-point perspective. So I want to place my widgets at the angle of the perspective. Unfortunately, the accordian widget won't visually work for my purpose, but I think the Composition widget might. However, can the composition widget container be rotated so that it lies on an angle ? (like the accordion widget now can)  And can any of the widgets other than the accordian widget be rotated like that? I hope so! Thanks.

    Hi,
    The only other panel you can rotate same as the accordion panel is the tabbed panel. You can also rotate the State Button but I don't think that will be of any help to you.
    Regards,
    Aish

  • How to Identify whether string contains only numbers

    Hi Experts,
    How to identify whether a string contains only numbers...
    Thanks & Regards,
    Neeraj.

    Hi Neeraj,
    ISNUMERIC(String_Field)
    The above function returns '0' for non-numerics and
    '1' for numeric
    Hope this helps.
    Regards,
    Bala

  • Need reg_exp for checking the string contains only alphanumeric or not

    Dear All,
    I need to check the given string in if condtion contains only the alphanumeric or not pls help me..
    like
    if reg_exp then
    end if;
    thanks,
    Oracle

    Hi,
    REGEXP_LIKE ( str
                , '[^[:alnum:]]'
                )returns TRUE if the string str contains any character other than an alphanumeric.
    You can use this wherever conditions are allowed, such as a WHERE clause or a CASE expression. For example:
    SELECT     str
    .     CASE
             WHEN  REGEXP_LIKE ( str
                         , '[^[:alnum:]]'
             THEN  'Contains speace, punctuation or special symbol'
             ELSE  'Okay'
         END               AS is_alnum
    FROM     table_x
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    Edited by: Frank Kulash on Dec 30, 2011 4:37 AM

  • How can i encrypt "String" which present a Password

    i have a String which present password, how can i encrypt the password while i save it to an XML file and how i decipher the password when i load it from the XML file.
    Thanks

    You don't generally encrypt passwords. You simply hash them. There should rarely, if ever, be a reason to decrypt a password.
    http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html
    http://java.sun.com/j2se/1.4.2/docs/guide/security/jce/JCERefGuide.html

  • How to select a field containing only alphabet.

    Post Author: tantk
    CA Forum: General
    I want to select records with only alphabet in a field.
    Can't seem to find any finctions to do this in CR XI.
    e.g Reference ID
    ABCXYS - Select this record
    173839S - Don't select
    UDHHW12 - Don't select
    173746 - Don't select
    Thanks for the help in advance.

    Post Author: SKodidine
    CA Forum: General
    There might be an easier way but I just cant think of it right now.  Here is a way to get you started.
    Create a formula with:
    numbervar i;numbervar a := 0;//for i := 1 to length({table.refid}) do(if not({table.refid}[i] in chrw(65) to chrw(122)) then a := a + 1;);//if a = 0 then 'true' else 'false';
    Place this formula in the report header and suppress it.  Then in your record selection criteria place this line:
    {@yourformula} = 'true'
    This should fetch only those records that either have a space or all alphabets for the refID.

  • Can the standard datepicker show only Month and Year

    Hi All,
    My requirement is to show the Date Picker with only the Month picklist and Year picklist.
    That is there shouldnt be the date table below.
    Is it possible to show...
    Thank You,
    Sombit.

    Sombit,
    You can create a poplist and show there Month & Year. like Jan, 2009, Feb- 2009.
    Thanks
    --Anil                                                                                                                                                                                                                           

  • Serialize String containing only whitespace such as a " " character

    I'm having dufficulty figuring out how to serialize a String property
    [XmlElement("DescriptionDelimiter1")]
    public String DescriptionDelimiter1
        get { return _DescriptionDelimiter1; }
        set { _DescriptionDelimiter1 = value; }
    Granted, I don't really need the XmlElement tag but just in case I want to change the name of the XML element...
    Anyway, what I get in XML is
    <ImportProfiles>
      <ImportProfile Name="HPH Import Profile">
        <ConcatenateDescriptions>true</ConcatenateDescriptions>
        <DescriptionDelimiter1 />
        <DescriptionDelimiter2>\r\n</DescriptionDelimiter2>
        <DescriptionDelimiter3>\t</DescriptionDelimiter3>
      <ImportProfile>
    </ImportProfiles>
    The problem is when serialized, if the value is " " or a single space, the result is <DescriptionDelimiter1 /> which when deserialized sets the string's value to "" with is not the value I need. I've looked into using CData but there doesn't seem to be a simple way to implement it... I expect
    <DescriptionDelimiter1> </DescriptionDelimiter1>
    or
    <DescriptionDelimiter1><[CDATA[ ]]></DescriptionDelimiter1>
    Is there some setting I can use when serializing the object to indication the process should not trim away whitespace?
    The following is the method used to serialize my object:
    public static String Serialize(DataImportBase dib)
        System.Type[] ArrType = new Type[1];
        ArrType[0] = typeof(System.DBNull);
        XmlSerializer xs = new XmlSerializer(typeof(DataImportBase), ArrType);
        System.IO.MemoryStream aMemoryStream = new System.IO.MemoryStream();
        xs.Serialize(aMemoryStream, dib);
        return System.Text.Encoding.UTF8.GetString(aMemoryStream.ToArray());
    Thanks for any assistance!!!
    Chris

    I have looked through the classes for XML serialization but I haven't found anything that seems to allow one to set that attribute xml:space declaratively on members.
    One way to change the serialization behaviour would be to write a specialized XmlWriter that takes a list of element names for which it writes out the xml:space attribute. This can be done with a few lines if you use the XmlWrappingWriter from the project http://www.codeplex.com/Wiki/View.aspx?ProjectName=MVPXML. The code for XmlWrappingWriter is also shown in Oleg's blog.
    If you use that then you can set up a specialized XmlWriter as follows:
    public class XmlSpaceWriter : XmlWrappingWriter
    private XmlQualifiedName[] ElementNames;
    public XmlSpaceWriter(TextWriter output, XmlQualifiedName[] elementNames)
    : base(XmlWriter.Create(output))
    ElementNames = elementNames;
    public override void WriteStartElement(string prefix, string localName, string ns)
    base.WriteStartElement(prefix, localName, ns);
    foreach (XmlQualifiedName name in ElementNames)
    if (name.Namespace == ns && name.Name == localName && base.XmlSpace != XmlSpace.Preserve)
    base.WriteAttributeString("xml", "space", "http://www.w3.org/XML/1998/namespace", "preserve");
    break;
    and use it like this
    Foo foo = new Foo();
    foo.Bar = " ";
    foo.Example = " ";
    XmlSerializer serializer = new XmlSerializer(typeof(Foo));
    StringWriter stringWriter = new StringWriter();
    XmlSpaceWriter spaceWriter = new XmlSpaceWriter(stringWriter, new XmlQualifiedName[] {new XmlQualifiedName("Bar")});
    serializer.Serialize(spaceWriter, foo);
    spaceWriter.Close();
    string markup = stringWriter.ToString();
    The result then looks like this:
    <?xml version="1.0" encoding="utf-16"?><Foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Bar xml:space="preserve"> </Bar><Example> </Example></Foo>
    The example code above has just one constructor for a TextWriter but the code could obviously easily extended to have further constructors taking e.g. a stream.

  • Can the iPad 1 really only handle 3 audio tracks?

    Whenever I put in more than 3 tracks in GarageBand, it instantly crashes. Is the measly 256 MB of RAM for the iPad 1 only enough to pull 3 audio tracks? I can sometimes add a 4th track, but as soon as I mess around with any kind of settings it crashes.
    I just had to get my question confirmed.

    Hi...
    Tap Settings > General > Reset > Reset Network Settings
    Then restart your iPad.   Hold the On/Off Sleep/Wake button down until the red slider appears. Slide your finger across the slider to turn off iPhone. To turn iPhone back on, press and hold the On/Off Sleep/Wake button until the Apple logo appears.
    If that didn't help, try here > iOS: Troubleshooting Wi-Fi networks and connections
    edited by:  cs

  • The call stack contains only external code

    Suddenly my project has gone into a non-working state and it seems impossible to debug it. The last time this happened was related to a variable declared in a module that referenced a file location. This time I have no idea what is going on. I took a screenshot
    of the error, in hopes someone can help. 
    I'm using Visual Basic Express 2012
    Programming is mostly just a hobby for me :)

    "Are you using default form instances?"
    I have no idea what that means.
    Programming is mostly just a hobby for me :)

  • Can I encrypt a string with RSA encryption using DBMS_CRYPTO?

    We have an web application that does a redirect thru a database package to a 3rd party site. They would like us to encrypt the querystring that is passed using RSA encryption. The example that they've given us (below) uses the RSA cryptographic service available in .NET. Is it possible to do this using DBMS_CRYPTO or some other method in Oracle?
    Below are the steps outlined to use the key to generate the encrypted URL
    2.1 Initialize Service
    The RSA cryptographic service must be initialized with the provided public key. Below is sample code that can be used to initialize the service using the public key
    C#
    private void InitializeRSA( string keyFileName )
    CspParameters cspParams = new CspParameters( );
    cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
    m_sp = new RSACryptoServiceProvider( cspParams );
    //Load the public key from the supplied XML file
    StreamReader reader = new StreamReader( keyFileName );
    string data = reader.ReadToEnd( );
    //Initializes the public key
    m_sp.FromXmlString( data );
    2.2 Encryption method
    Create a method that will encrypt a string using the cryptographic service that was initialized in step 2.1. The encryption method should convert the encryption method to Base64 to avoid special characters from being passed in the URL. Below is sample code that uses the method created in step 2.1 that can be used to encrypt a string.
    C#
    private string RSAEncrypt( string plainText )
    ASCIIEncoding enc = new ASCIIEncoding( );
    int numOfChars = enc.GetByteCount( plainText );
    byte[ ] tempArray = enc.GetBytes( plainText );
    byte[ ] result = m_sp.Encrypt( tempArray, false );
    //Use Base64 encoding since the encrypted string will be used in an URL
    return Convert.ToBase64String( result );
    2.3 Generate URL
    The query string must contain the necessary data elements configured for you school in Step 1. This will always include the Client Number and the Student ID of the student clicking on the link.
    1.     Build the query string with Client Number and Student ID
    C#
    string queryString = “schoolId=1234&studentId=1234”;
    The StudentCenter website will validate that the query string was generated within 3 minutes of the request being received on our server. A time stamp in UTC universal time (to prevent time zone inconsistencies) will need to be attached to the query string.
    2.     Get the current UTC timestamp, and add the timestamp to the query string
    C#
    string dateTime = DateTime.UtcNow.ToString(“yyyy-MM-dd HH:mm:ss”);
    queryString += “&currentDT=” + dateTime;
    Now that the query string has all of the necessary parameters, use the RSAEncrypt (Step 2.2) method created early to encrypt the string. The encrypted string must also be url encoded to escape any special characters.
    3.     Encrypt and Url Encode the query string
    C#
    string rsa = RSAEncrypt(querystring);
    string eqs = Server.UrlEncode(rsa);
    The encrypted query string is now appended to the Url (https://studentcenter.uhcsr.com), and is now ready for navigation.
    4.     Build the URL
    C#
    string url = “https://studentcenter.uhcsr.com/custom.aspx?eqs=” + eqs

    The documentation lists all the encyrption types:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm#ARPLS664

  • Where we can find the detail infomation about the Value String of automatic

    Where we can find the detail infomation about the Value String of automatic?
    such as WE06,WE01 and so on.

    Hai,
               Value string keys are for SAP internal usage. It is just a pointer to the transaction event key which is necessary for automatic account determination.
               Movement types are linked to transaction keys via valuation string in OMWN T-code.
               The R/3 System automatically determines the value string assigned to a specific transaction. It depends partly on entered parameters manually and partly on parameters derived internally by the system. The value string contains all posting transactions that are possible for a certain transaction. The program decides which of these posting transactions lead to G/L account postings in individual cases. You cannot define this in Customizing.
    Value string WE01, for the goods receipt for a purchase order into stock, contains transactions BSX and WRX.
    WE01: BSX, WRX, PRD, KDM, EIN, EKG, BSV, FRL, FRN, BSX, UMB.
    WA14: BSX ,PRD, BSX, UMB
    WA01: BSX, GBB, PRD, BSX, UMB
    Value string RE05 contains transactions BSX and UMB.
    In the standard system, value string WE01 is assigned to goods receipts (and also cancellations and return deliveries) for Standard and Subcontracting purchase order items without account assignment concerning valuated material into stock. In the case of (valuated) goods receipts for purchase order items not subject to account assignment,
    post the items to a stock account using the transaction key BSX and make an offsetting entry to a GR/IR clearing account. A price difference posting (transaction key PRD) is only used if the valuated material is subject to standard price control and if the order price (or invoice price) is different from the standard price. Transaction key KDM is required in Inventory Management for purchase orders in foreign currencies because of differences in exchange rates between goods receipts and invoice receipts, unless the material can not be debited or credited because it is subject to standard price control.
    The transaction keys EIN and EKG (and possibly FRE – see account determination for delivery costs) are only used in company codes where purchase account management is active (as required in France and Belgium for example).
    The transaction keys BSV, FRL, and FRN are only used for the Subcontracting item category.
    Value string WA14 is defined for deliveries without charge (movement type 511).
    The following scenarios are possible:
    Delivery without charge for material subject to moving average price control &#8594; No accounting document
    Delivery without charge for material subject to standard price control (and if the posting date is in the previous period – standard price in the posting period = standard price in the current period) &#8594; Inventory posting (receipt at standard price) and offsetting entry to price differences account
    Delivery without charge for material subject to standard price control, with posting date in the previous period and the standard price in the posting period is different to the standard price in the current period &#8594; Inventory posting (receipt at standard price) and offsetting entry to price differences account (posting in the previous period) &#8594; Stock correction posting and Revenue/expense from revaluation (posting in the current period)
    In the standard system, value string WA01 is assigned to goods issues and other goods receipts. The R/3 System uses an additional influencing factor, account grouping, to differentiate further between the various movements during account determination.
    Hope it will be Helpful 4 u.
    Reward Point if Useful.

  • How to find out if a string is all alphabets

    Hi,
    How can I find out if a string contains all alphabets? Please help. Thanks.

    Hi,
    How can I find out if a string contains all
    all alphabets? Please help. Thanks. I am not sure if there's easier way. But this code should do what you want:
    boolean bAlpha = true;
    for (int i=0; i<str.length; i++)
    if (!Character.isLetter(str.charAt(i))){
    bAlpha = false;
    break;
    //bAlpha is true if str contains only alphabets.

  • Can the Ring Properties/Edit Items/Labels be populated by array values?

    Can the Ring Properties/Edit Items/Labels be populated by array values?
    I'm trying to troubleshoot an existing LabView 7.0 application at our office (this is only the beginning of my nightmare) and I'm finding that there is an array being created out of discrete Elements, which is then being indexed using the Indexed Array function, using a Ring control as the Index input. 
    What I'm seeing is that whoever created this "Appication" seems to require that any new 'elements' that need to be added to the array need to added in AT LEAST two locations (add the element to the array and add a label on the Edit Items tab of the Ring control used to index the array) and there may be more locations I haven't found that also needs the same information.  Since I can't see any way for the array and the ring control to 'compare' the text strings, I'm assuming the array is being indexed using the 'values' from the Edit Items tab.  Ths would allow different text in the Ring dropdown than is actually contained in the text of the array.
    This is contrary to most of the coding practices I've learned, so I'm wondering if I could use the text strings contained in the array itself to populate Item list in the Ring control?
    Later I can create an 'entry form' that would allow new parts to be added by staff that doesn't require knowledge of LabView programming. (The "Users" should NEVER have to see the underlying block diagrams/code to add or edit parts ot test parameter values.)
    Thanks

    In 8.2 you can do this with a property node and the "Strings [ ] Property".  It accepts an array of strings.  Order of strings in array sets the order in the control.  Should work in 7.0 as well.

Maybe you are looking for